Thursday, 15 May 2014

php - How to close a popup when a button is pressed? -


I want to close a page when I press a button. I am using the script add_address.php to output a list of email addresses from the message box and send me the email address to text box < Code> send.php script

is the code for add_address.php:

   & Lt; Title & gt; Add email addresses ... & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form action = "send.php" method = "post" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Td> & Lt; Textarea name = "message" cols = "50" lines = "20" & gt; & Lt; / Textarea & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; Td colspan = "2" align = "left" & gt; & Lt; Input type = "submit" name = "send" value = "add email" style = "height: 35px; width: 100px" & gt; & Lt; / TD & gt; & Lt; / Table & gt; & Lt; / Form & gt; & Lt; / Body & gt;  

Here is the code for send.php:

  & lt ;? Php if ($ _ POST ['message']) {$ email = explosion ("\ n", $ _POST ['message']) // // textarea explosion on a line break in array $ email_str = implode ",", $ Email); // Take each of the emails and entrap it together?}? & Gt; DOCTYPE HTML PUBLIC "- // W3C // DTT XHTML 1.0 Transcription // n" "http: //www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" html xmlns = "http://www.w3.org/1999/xhtml" & gt; & lt; top & Gt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" /> gt; title & gt; send email & lt; / title & gt; & Lt; link type = "text / css" rel = "stylish T "href =" style.css "/>  gt; body & gt; & lt; form action =" pr_send.php "method =" post "& gt; & lt; Table & gt; & lt;! - & lt; tr & gt; from & lt; TD & gt; from: & lt; / td> gt; & lt; td & gt; & lt; input type = "text" name = "To"> gt; & lt; / td> & lt; / TR & gt; - & gt; & lt; tr & gt; & lt; td & gt; & lt; input type = "button" Name = "to" value = "" style = "height: 24 pixels; Width: 24 pixels; Background: URL ('Address Book'); Limit: None; "onClick =" popup () "& gt; to: & lt; / td> gt; & lt; td & gt; & lt; input type =" text "name =" to "value = "& Lt ;? Php if (! Below ($ email_str)) {echo $ email_str;}? & Gt; Style = "height: 15px; width: 650px" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Subject: & lt; / TD & gt; & Lt; Td> & Lt; Input type = "text" name = "topic" style = "height: 15px; width: 650px" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Message: & lt; / TD & gt; & Lt; Td> & Lt; Textarea name = "message" cols = "90" rows = "20" & gt; & Lt; / Textarea & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td colspan = "2" align = "left" & gt; & Lt; Input type = "submit" name = "send" value = "style =" height: 35px; width: 100px; background: url ('send.png'); boundary: none "& gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; Script type = "text / javascript" & gt; Function popup () {window.open ("add_address.php", "_blank", "toolbar = yes, scrollbar = yes, resizable = yes, top = 100, left = 500, width = 400, height = 400"); } & Lt; / Script & gt; & Lt; / Html & gt;  

What my snippets have been shown, it will only allow me to output the list of email addresses in the message box and it will redirect to To output the list of email addresses in the text box without the .php page.

You should not use the window. Open, instead you should create a popup function with junkery and CSS or use pre-built libraries (tagit.js):


No comments:

Post a Comment