If you've copied-and-pasted that script, you might want to correct this
line:

<scrip language="JavaScrip">

Both the words "script" and "Javascript" have a T on the end of them :-)

On the other hand, why don't you just use PHP for the whole thing? Get the
e-mail address from a form, make the action of this form $PHP_SELF, and have
a condition along the lines of

if ($submit) {
  ... send the mail
} else {
  ... display the form
}

Then you don't have to switch to and from client- and server-side scripts,
and you don't risk your system being fubar'd by people who browse with
Javascript turned off.

Just a thought.

Cheers
Jon


-----Original Message-----
From: Fang Li [mailto:[EMAIL PROTECTED]]
Sent: 29 January 2001 17:30
To: [EMAIL PROTECTED]
Subject: [PHP] mail( ) question


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