Urgent help needed asap please! |
Urgent help needed asap please! |
kop442000 |
Nov 16 2010, 04:19 PM
Post
#1
|
Group: Members Posts: 8 Joined: 9-November 07 Member No.: 4,272 |
Hi guys.. I have a website that has a box where people can submit their email addresses on there.
I got the form working fine using php and the email addresses were coming into my email address as they should. Now people are visiting the site, but I have realised that the form is not working anymore! When they submit is says "failure". I'm not sure that I have changed anything so I don't know what is wrong. Here is the code: "<?php if ($_POST["email"]<>'') { $email_from = 'info@runyourownrestaurant.com'; $ToEmail = 'runyourownrestaurant@gmail.com'; $EmailSubject = 'New Investor'; $mailheader = "From: ".$_POST["email"]."\r\n"; $MESSAGE_BODY .= $_POST["email"]; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); ?> <center><b><font face="arial" size="2">Your have registered successfully - thank you! We'll be in touch when the bar on the right reaches the top.<p></font></b></center> <?php } else { ?> <form action="index.php" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="bodytext"><center><b><font face="arial" size="2">I'm interested and would potentially like to be involved. Here's my email address:</font></b> <input name="email" type="text" id="email" size="20"> <input type="submit" name="Submit" value="Send"></td> </tr> </table> </form> <?php }; ?> " If anyone could tell me why it's not working that would be amazing!! Thank you!! |
kop442000 |
Nov 16 2010, 04:38 PM
Post
#2
|
Group: Members Posts: 8 Joined: 9-November 07 Member No.: 4,272 |
Hi guys.. I have a website that has a box where people can submit their email addresses on there. I got the form working fine using php and the email addresses were coming into my email address as they should. Now people are visiting the site, but I have realised that the form is not working anymore! When they submit is says "failure". I'm not sure that I have changed anything so I don't know what is wrong. Here is the code: "<?php if ($_POST["email"]<>'') { $email_from = 'info@runyourownrestaurant.com'; $ToEmail = 'runyourownrestaurant@gmail.com'; $EmailSubject = 'New Investor'; $mailheader = "From: ".$_POST["email"]."\r\n"; $MESSAGE_BODY .= $_POST["email"]; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); ?> <center><b><font face="arial" size="2">Your have registered successfully - thank you! We'll be in touch when the bar on the right reaches the top.<p></font></b></center> <?php } else { ?> <form action="index.php" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="bodytext"><center><b><font face="arial" size="2">I'm interested and would potentially like to be involved. Here's my email address:</font></b> <input name="email" type="text" id="email" size="20"> <input type="submit" name="Submit" value="Send"></td> </tr> </table> </form> <?php }; ?> " If anyone could tell me why it's not working that would be amazing!! Thank you!! (only think I can think of that I changed is that I got an email address with the host and they had a box when you set up your email that said: "Check this box to set the new email as default "From" address for emails sent from scripts in your hosting account" which I did. Could this be the problem? I deleted the mail box but the form still says "failure".) |
delambo |
Jan 4 2011, 09:12 PM
Post
#3
|
Novice Group: Members Posts: 26 Joined: 19-November 09 Member No.: 10,378 |
It looks to me like you have used some kind of program to generate your php script - maybe with your web host?
If so I would suggest you ask them for advise. Otherwise if you want to learn php a good place to start would be http://www.w3schools.com/php/default.asp I am afraid I cant see past your first line if ($_POST["email"]<>'') and wonder what on earth you mean by this? Translated to English it reads if $_POST['email'] is less than or greater than nothing.... It would have been so much cleaner and simpler to have simply put CODE if ($_POST["email"]) |
Lo-Fi Version | Time is now: 28th April 2024 - 08:28 AM |