This is a discussion on "PHP Form returns error : mail expects most 5 parameters?" within the PHP Forum section. This forum, and the thread "PHP Form returns error : mail expects most 5 parameters? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP Form returns error : mail expects most 5 parameters?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
PHP Form returns error : mail expects most 5 parameters?
My php code looks like this:
However, I get the folling error message in my browser when the form is submitted: Warning: mail() expects at most 5 parameters, 9 given in d:\websites\welo381573\www\contact_us\message.php on line 10 Warning: Cannot modify header information - headers already sent by (output started at d:\websites\welo381573\www\contact_us\message.php: 10) in d:\websites\welo381573\www\contact_us\message.php on line 11 (Try it for yourself..) >Can anyone help? Is it true what the error message seems to imply that a mail() can only take a max of 5 parameters? If so, what is the way around this? Thanks Last edited by karinne; Oct 1st, 2007 at 13:41. Reason: Please use the vBcode [ php ] when inserting PHP code in your post. |
|
|
|
#2
|
|||
|
|||
|
Re: PHP Form returns error : mail expects most 5 parameters?
You have 9 parameters to your main command, which is too many.
The first parameter should be the destination email address. That's fine The second should be the subject. That looks good too. The third should be the body of the email. This is where I think you have gone wrong - you probably meant to write everything form $email through to $message in the email body, but that's not what you've done. I suggest you write $embody = "$email $day $month $year $messge"; before your mail command, then just use $embody in your mail() function call. The last parameter you gave to mail is fine too. |
|
#3
|
|||
|
|||
|
Re: PHP Form returns error : mail expects most 5 parameters?
Regarding your second error message: Header information is sent to the browser as soon as the page starts being processed. When you are going to use redirection, which is what you effectively are doing, you need to buffer the header output until you are ready to send it. You do this by having:
|
|
#4
|
|||
|
|||
|
Re: PHP Form returns error : mail expects most 5 parameters?
Quote:
|
|
#5
|
|||
|
|||
|
Re: PHP Form returns error : mail expects most 5 parameters?
Thank you both Geoff and Graeme.
Yes the second error did resolve itself after fixing the intial problem... All is working now, thanks! |
|
#6
|
|||
|
|||
|
Re: PHP Form returns error : mail expects most 5 parameters?
I tried to configure as previously mentioned code below :
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/1.3.33 Server at www.domain.com Port 80 In my email however, I can get the first and last name, phone number, and comments. I can not get the email address. Please help. Last edited by karinne; Oct 1st, 2007 at 13:41. Reason: Please use the vBcode [ php ] when inserting PHP code in your post. |
![]() |
| Tags |
| php, form, returns, error, mail, expects, most, parameters |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] parse error, unexpected T_EXIT in php mail script | Posie | PHP Forum | 8 | Dec 13th, 2007 14:21 |
| PHP Mail Submit Form Error | longstand | PHP Forum | 6 | Nov 11th, 2007 16:02 |
| Setting up form returns | shifty | Web Page Design | 3 | Aug 21st, 2006 16:03 |
| visitors name not displayed in mail after filling in mail form | made on earth | PHP Forum | 7 | Nov 16th, 2005 22:43 |
| E-mail form ??????? | pittypatter | Web Page Design | 3 | Apr 11th, 2005 23:42 |