Jump to content

foxdenvixen

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

foxdenvixen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That's ok. I do thank you for the help you have provided.
  2. I did this and got an error message. So I removed it and replaced it with the other php.ini file and even though I was redirected to the thank you page, still no email. This is getting so frustrating.
  3. I did get it to work and everything posted as it should have. Then suddenly I was not getting an email back again. I contacted godaddy.com and they told me I had to add my own php5.ini file? I had copied the file from my client's site to my site and that is what got it to work before but it stopped. I have no idea how to write a php.ini file to get the code to work.
  4. I change the code for state and for message but they are still not picking up the text in the fields. Also I noticed a Javascript error on the contact form page. It says - Message: 'Validator' is undefined Line: 72 Char: 1 Code: 0 URI: http://foxden.herobo.com/contact.html Line 72 is - var frmvalidator = new Validator("contactform"); This is the first line of the form - <form method="post" name="contactform" action="contact-form-handler.php">
  5. Great news!!! I did some more research, copied the php.ini file from my client's site over to mine, followed a suggestion from godaddy.com to go into manage account - content - IIS management - recycle app pool and it works now. I just need to get the state or province and web site request to show up in the email using the code that I have.
  6. Well this is interesting...I uploaded the contact form files to my clients godaddy.com site, which is a Linux account and tested the form. It works. So something is wrong on my Windows running IIS7 account. However, the fields that I played with are still not working so I need to see what I did incorrectly with the code.
  7. Unfortunately even though I did not get a syntax error message, no email came through. I posted it on the free PHP hosting site and it works just fine. Something is wrong on the godaddy.com side and I just can't figure out what. I am messing around with the original handler that I had and am trying to learn what everything does. I don't know PHP but am willing to learn. I got all the fields to post that I want but some of them are coming back blank so I have a feeling I am not using the correct syntax. <?php $errors = ''; $myemail = 'corifoxworthy@foxdenwebsolutions.com'; if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message'])) { $errors .= "\n Error: all fields are required"; } $name = $_POST['name']; $email_address = $_POST['email']; $city = $_POST['city']; $state = $_POST['state or province']; $country = $_POST['country']; $message = $_POST['web site request']; if (!eregi( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email_address)) { $errors .= "\n Error: Invalid email address"; } if( empty($errors)) { $to = $myemail; $email_subject = "Web site form submission: $name"; $email_body = "You have received a new web site request. ". " Here are the details:\n Name: $name \n Email Address: $email_address \n City: $city \n State or Province: $state \n Country: $country \n Web Site Request: $message"; $headers = "MIME-Versin: 1.0\r\n" . "Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n" . "Content-Transfer-Encoding: 8bit\r\n" . "From: $myemail\r\n" . "Reply: $email_address\r\n". "Return-Path: $email_address\r\n". "X-Mailer: PHP" . phpversion(); mail($to,$email_subject,$email_body,$headers); //redirect to the 'thank you' page header('Location: request_response.html'); exit(); } ?> ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Contact form handler</title> </head> <body> <!-- This page is displayed only if there is some error --> <?php echo nl2br($errors); ?> </body> </html> I don't know if you are parient enough with me to explain what the code is doing because I would like to learn.
  8. Another syntax eror - Parse error: syntax error, unexpected ';' in D:\Hosting\2925570\html\foxden_site_1\contact-form-handler1.php on line 12 line 12 - $message .= $key ." = ".$val."\n";
  9. I uploaded you code and got this error - Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\Hosting\2925570\html\foxden_site_1\contact-form-handler1.php on line 10 Here is the code again. <?php if (isset($_GET['success'])){ ?><p><span style="color:green;">Message successfully sent.</span> Thank you!</p><?php } else { if (!empty($_POST['email']) && !empty($_POST['message'])) { $to = 'corifoxworthy@foxdenwebsolutions.com'; // your email address, can be @gmail.com, etc. $subject = 'Contact from foxdenwebsolutions.com'; // change yoursite.com to your own domain name //$message = $_POST['message']."\r\n\r\nSender IP: ".$_SERVER["REMOTE_ADDR"]; //this was the old message $message "Email posted from IP:".$_SERVER["REMOTE_ADDR"]. "\n\n"; foreach ($_POST as $key => $val{ $message .= $key ." = ".$val."\n"; } $headers = 'From: '.$_POST['email']."\r\n". 'Reply-To: '.$_POST['email']."\r\n"; mail($to, $subject, $message, $headers); header("Location: request_response.html"); // redirects the sender to success page so he or she doesn't accidentally send multiple identical messages } else { ?><p><span style="color:red;">Error detected.</span> Please make sure you have filled all fields. Press back button to go back.</p> <?php } } ?> Line 10 is $message "Email posted from IP:".$_SERVER["REMOTE_ADDR"]. "\n\n"; I have looked at some more forms but they are set up with tables. I don't want to use tables and they don't have the fields that I want.
  10. I just tried this script and it worked but there is not enough that it picks up for what I need but I know that it works. <?php if (isset($_GET['success'])) { ?><p><span style="color:green;">Message successfully sent.</span> Thank you!</p><?php } else { if (!empty($_POST['email']) && !empty($_POST['message'])) { $to = 'corifoxworthy@foxdenwebsolutions.com'; // your email address, can be @gmail.com, etc. $subject = 'Contact from foxdenwebsolutions.com'; // change yoursite.com to your own domain name $message = $_POST['message']."\r\n\r\nSender IP: ".$_SERVER["REMOTE_ADDR"]; $headers = 'From: '.$_POST['email']."\r\n". 'Reply-To: '.$_POST['email']."\r\n"; mail($to, $subject, $message, $headers); header("Location: request_response.html"); // redirects the sender to success page so he or she doesn't accidentally send multiple identical messages } else { ?><p><span style="color:red;">Error detected.</span> Please make sure you have filled all fields. Press back button to go back.</p><?php } } ?> I am posting the form code as well so you can see what fields I need this to pick up. <form method="post" name="contactform" action="contact-form-handler1.php"> <p align="center"> <label for='name'>Your Name:</label> <br /> <input type="text" name="name" /> </p><br /> <p align="center"> <label for='email'>Email Address:</label> <br /> <input type="text" name="email" /> </p><br /> <p align="center"> <label for='city'>City:</label> <br /> <input type="text" name="city" /> </p><br /> <p align="center"> <label for='state'>State or Province:</label> <br /> <input type="text" name="state" /> </p><br /> <p align="center"> <label for='country'>Country:</label> <br /> <input type="text" name="country" /> </p><br /> <p align="center"> <label for='message'>Web Site Request:</label> <br /> <textarea name="message" cols="40" rows="5"></textarea> </p><br /> <p align="center"> <input type="submit" value="Submit" /><input type="reset" value="Reset" /></p><br /> <input type="hidden" name="redirect" value="request_response.html" /> </form>
  11. I added the code you suggested above - $headers = "MIME-Versin: 1.0\r\n" . "Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n" . "Content-Transfer-Encoding: 8bit\r\n" . "From: $myemail\r\n" . "Reply: $email_address\r\n". "Return-Path: $email_address\r\n". "X-Mailer: PHP" . phpversion(); Is this the correct syntax?
  12. Added code as you suggested and here is the error - sending mail Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in D:\Hosting\2925570\html\foxden_site_1\contact-form-handler.php on line 39
  13. I did upload the phpinfo.php file and see that these are set as follows - sendmail_from webmaster@secureserver.net webmaster@secureserver.net sendmail_path no value no value SMTP relay-hosting.secureserver.net relay-hosting.secureserver.net They did tell me that if I was not using mail(); then I needed to add code for the SMTP. How do I edit the php.ini file for godaddy and what do I need to change in the code to have it go through the relay server? Sorry for being PHP ignorant.
  14. Andrew - I added the code that you posted and I still am not getting an email sent to me. Now godaddy.com requires that you set up the email address that the mail is going to and I have done this using the same email in the code above. I have waited 15 minutes and no email. I checked my mail on godaddy.com just in case...not there. I pull my email through Outlook and nothing has gone to my junk email box. I have looked at several different sites and a lot of people are having problems with godaddy and emails. Maybe I should try another PHP form? I am not sure. I just want something quick and simple that visitors can fill out to request info on a web site. I do appreciate your help.
  15. Hello, First of all I am NOT a PHP programmer. I am a web designer that was looking for a simple PHP contact form to add to my web site. I originally had a .NET form that I just couldn't get to look professional. I found a good form, tweaked the HTML, added the email address that I needed the form to go to, and uploaded it to my site hosted by godaddy.com. I have a Windows hosting account and it has been upgraded to IIS7, which is supposed to run PHP 5.x. The script did not work. I opened a quick free PHP site on a different host and tried it and it does work. I contacted godaddy.com and they informed me that I can use 3rd party scripts. Here is their email to me - "You are not required to use our form mailers. If you use the mail() function in your PHP, you do not need to specify an outgoing mail server. If you are using some other method besides mail() in your PHP code, use relay-hosting.secureserver.net for your relay server." Here is the code that I found. I do not know PHP so I am not sure if it follows what godaddy.com is requiring for it to work. <?php $errors = ''; $myemail = 'corifoxworthy@foxdenwebsolutions.com'; if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message'])) { $errors .= "\n Error: all fields are required"; } $name = $_POST['name']; $email_address = $_POST['email']; $message = $_POST['message']; if (!eregi( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email_address)) { $errors .= "\n Error: Invalid email address"; } if( empty($errors)) { $to = $myemail; $email_subject = "Web site form submission: $name"; $email_body = "You have received a new web site request. ". " Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message"; $headers = "From: $myemail"; $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); //redirect to the 'thank you' page header('Location: request_response.html'); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Contact form handler</title> </head> <body> <!-- This page is displayed only if there is some error --> <?php echo nl2br($errors); ?> </body> </html> The HTML page links to this page. I have uploaded a phpinfo page to test and it works so PHP is installed and running. Could someone look at this code and let me know if there is anything I should add or change to get this to work on godaddy.com. Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.