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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to