Thanx for all the help, it was so quick. I would have helped if I checked
the manual first though :)


Expecting the world to treat you fairly because you are a good person is a
little like expecting the bull not to attack you because you are a
vegetarian."

Unix specialist &  Web Developer
Bonzai Web Design
http://www.bonzai.org.za

----- Original Message -----
From: "Randall Barber" <[EMAIL PROTECTED]>
To: "Rudi Ahlers" <[EMAIL PROTECTED]>
Sent: Sunday, March 04, 2001 9:14 PM
Subject: Re: [PHP-DB] Mail Form error


There are only 4 parameters allowed in the mail function, PHP4.0 Manual pg
535.

mail($to, $subject, $message, $additional_headers);

Thus for your purposes below,

> if ($ACTION == "send-mail") {
> mail($MYEMAIL,$TITLE,$NAME,$COMPANY,$CITY,$COUNTRY,$EMAIL,$NUM,"From:
> $EMAIL");
> echo "<h2>Your information has been submitted.</h2>\n";
> } else {
> echo "<h2>Use this form to submit your information.</h2>\n";
> }
> ?>

Try this:

$extra_header = "From: $EMAIL";
$subject = "Submitted Form";
$message = "$TITLE\n$NAME\n$COMPANY\n$CITY\n$COUNTRY\n$EMAIL\n$NUM";

mail($MYEMAIL, $subject, $message, $extra_header);

Hope that helps
RDB



----- Original Message -----
From: "Rudi Ahlers" <[EMAIL PROTECTED]>
To: "PhP List" <[EMAIL PROTECTED]>
Sent: Sunday, March 04, 2001 11:34 AM
Subject: [PHP-DB] Mail Form error


> Can someone please tell me why this form doesn't work?
> I get the following error:
> Warning: Wrong parameter count for mail() in
> /home/www/projects/temp/mailform4.php on line 11
>
> The code is as follows:
> <html>
> <head>
> <meta name="Author" content="Chris Mills">
> </head>
> <body>
>
> <?php
> $MYEMAIL = "root@localhost";
>
> if ($ACTION == "send-mail") {
> mail($MYEMAIL,$TITLE,$NAME,$COMPANY,$CITY,$COUNTRY,$EMAIL,$NUM,"From:
> $EMAIL");
> echo "<h2>Your information has been submitted.</h2>\n";
> } else {
> echo "<h2>Use this form to submit your information.</h2>\n";
> }
> ?>
>
> <b><u>Please fill in the form and then click submit:</u></b>
> <FORM METHOD=POST>
>
> <INPUT TYPE=HIDDEN NAME="ACTION" VALUE="send-mail">
>
> <PRE>Title:          <INPUT TYPE=TEXT NAME="TITLE"></PRE>
> <PRE>Name:           <INPUT TYPE=TEXT NAME="NAME"></PRE>
> <PRE>Company:        <INPUT TYPE=TEXT NAME="COMPANY"></PRE>
> <PRE>City:           <INPUT TYPE=TEXT NAME="CITY"></PRE>
> <PRE>Country:        <INPUT TYPE=TEXT NAME="COUNTRY"></PRE>
> <PRE>Email:          <INPUT TYPE=TEXT NAME="EMAIL"></PRE>
> <PRE>Contact number: <INPUT TYPE=TEXT NAME="NUM"></PRE>
>
> <INPUT TYPE=SUBMIT> * <INPUT TYPE=RESET>
>
> </FORM>
> </body>
> </html>
>
>
> Thanx
> Rudi Ahlers
>
>
> --
> PHP Database 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 Database 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