Re: mail( ) question

From: Date: Mon, 29 Jan 2001 21:52:00 +0000
Subject: Re: mail( ) question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-37132@lists.php.net to get a copy of this message
This isn't going to work the way it's set up now. Javascript is processed by the visitor's browser, while PHP is processed by the server before the page is ever sent. So in essence, PHP doesn't care one bit what anything outside of the <?php ?> tags does. Therefore, you're instructing PHP to do this: mail( That doesn't mean anymore to PHP than it does to me. It's definately not a function without the arguments and closing paren. If you're not following me, I suggest you go read up in the PHP manual and any sites you can find on the links page; you might even check the archives of this list, I know we've been over it several times. It's a matter of client-side scripting vs. server-side scripting. --toby Fang Li wrote: > > Hi All: > > Would anyone tell me how to correct the code in mail( ) function? Thanks a > lot. > > <html> > <head> > <scrip language="JavaScrip"> > function askEmailAddress( ){ > var inputedData = prompt("The email address you want send > to:"," "); > if(confirm("The email address you want send to is" + inputedData + > "?")){ > alert("OK, the article will send to " + inputedData + > "!"); > } > } > </script> > </head> > > <body> > ....... > > <?php > mail(?> <script language="JavaScript"> > document.write(inputed_data)</script> > <?php , "My Subject", "Line 1\nLine 2\nLine 3"); ?> > > </body> > </html> > > Fang Li > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#37132) next »