|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
help me please
Hi,
I have been following the tutorial fine until this point. I just can't get the code below to work. If you press the submit before filling in the email and message field it just reloads the feedback.html. Ok that bit of the code works but everything below doesn't. Even if I fill in all the fields the mail isn't sent whereas with the code earlier on in the tut it worked fine. Can you help me? I am new to all this and I am having teething problems. <? if (!isset($email) || !isset($message)) { header( "Location: URL" ); } elseif (empty($email) || empty($message)) { header( "Location: URL" ); } else { mail( "yourname@yourdomain.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: URL" ); } ?> Cheers Benjb |
|
#2
|
|||
|
|||
|
Benjb,
What's the problem you're having? Are you testing this on a server, or on a local machine? If it's on a local machine, did you configure the mail settings: [mail function] ; For Win32 only. SMTP = localhost ; For Win32 only. sendmail_from = me@localhost.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = Also, if you're running PHP with "register_globals" set to OFF, you'll have to make use of the superglobal arrays "$_POST" and "$_GET". So in your example, depending on whether you're using "POST" or "GET" in the method definition of your FORM, you would use this: PHP Code:
Any information on your problem/error you're having would be helpful. Also, for future reference, please read the forum rules on posting code and coding problems.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
Frank,
You are a star!! I must have had register_globals set to OFF. Thankyou Benjb |
|
#4
|
|||
|
|||
|
Benjb,
You're welcome! Anytime... |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > help me please |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|