Re: Mail Form error

From: Date: Sun, 04 Mar 2001 19:52:10 +0000
Subject: Re: Mail Form error
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-7110@lists.php.net to get a copy of this message
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" <rdb55@email.byu.edu> To: "Rudi Ahlers" <kopspier@bigfoot.com> 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" <kopspier@bigfoot.com> To: "PhP List" <php-db@lists.php.net> 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: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#7110) next »