dgow13 Posted February 25, 2010 Report Share Posted February 25, 2010 I wrote the php script for my contact form after watching the video series. I am new to php and tried to make it as simple as I could. I put all the right things on both the contact us and thank you pages. Worked great. I used the same format for one of my clients pages and I cannot get it to work. I copied and pasted, I also rewrote the entire script... still, it will not work on my clients site. tell me what I am doing wrong !!! Here are the codes: contactus.php page: George Kevin Broadband Internet Security Systems Support General Questions thankyou.php page: <?php //php form to email code// $name = $_REQUEST['name']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $to = $_REQUEST['to']; $interest = $_REQUEST['interest']; $message = $_REQUEST['message']; $headers = "From: $email"; $email_message = "Name: {$name}\n\rEmail: {$email}\n\rPhone: {$phone}\n\rTo: {$to}\n\rInterest: {$interest}\n\rMessage: {$message}"; mail('dgow@simplewebs13.com',$interest,$email_message,$headers); ?> Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 25, 2010 Report Share Posted February 25, 2010 Can you clarify: what exactly is not working about it? Are you getting any error messages? Quote Link to comment Share on other sites More sharing options...
dgow13 Posted February 25, 2010 Author Report Share Posted February 25, 2010 Can you clarify: what exactly is not working about it? Are you getting any error messages? No error message. You fill in the info and hit submit... it goes to the thank you page, as it should, but the email never shows up. I had my email listed for testing but, I've tried theirs and it doesn't work either. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 25, 2010 Report Share Posted February 25, 2010 What host are you using? Have you checked with them to make sure they allow the mail() function, or if there are any specific ways they want you to handle contact forms? (I've had issues with GoDaddy in the past with this, for example). Quote Link to comment Share on other sites More sharing options...
dgow13 Posted February 25, 2010 Author Report Share Posted February 25, 2010 What host are you using? Have you checked with them to make sure they allow the mail() function, or if there are any specific ways they want you to handle contact forms? (I've had issues with GoDaddy in the past with this, for example). I do host all my accts with GoDaddy. I didn't have a problem with mine and one other clients forms I wrote. Should I call GoDaddy? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 25, 2010 Report Share Posted February 25, 2010 That's probably where I would start. I can't remember the exact issue I had, but I just remember that the mail() function was disabled on one of the GoDaddy accounts (hosted on a Windows server) I worked with in the past. As far as I can tell, the code you are using should be fine. If you tried the exact same code and it was working fine on a different hosting setup, I'm guessing it has something to do with the host. Quote Link to comment Share on other sites More sharing options...
dgow13 Posted February 25, 2010 Author Report Share Posted February 25, 2010 That's probably where I would start. I can't remember the exact issue I had, but I just remember that the mail() function was disabled on one of the GoDaddy accounts (hosted on a Windows server) I worked with in the past. As far as I can tell, the code you are using should be fine. If you tried the exact same code and it was working fine on a different hosting setup, I'm guessing it has something to do with the host. I called GoDaddy and they said it was my script on the contact us page. He said I was missing a section of code at the top. I will include what he sent me but, this is nothing even close to what I learned on the videos with Stefan. First Name: Last Name: E-Mail: Comments: Type comments here. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 25, 2010 Report Share Posted February 25, 2010 Looks like they are requiring you to use the gdform script in order to send mail -- I'm pretty sure that is the issue I ran into to. More info on this: http://help.godaddy.com/article/510#gdform The thing I didn't like about this was that it made the forms impossible to customize. It simply spits out the contents of the form ordered alphabetically and submits it to an email -- there was no way/difficult to check for required fields, customize the email that the form sends, change the order of the contents of the email, validate data, etc. Quote Link to comment Share on other sites More sharing options...
dgow13 Posted February 25, 2010 Author Report Share Posted February 25, 2010 Looks like they are requiring you to use the gdform script in order to send mail -- I'm pretty sure that is the issue I ran into to. More info on this: http://help.godaddy.com/article/510#gdform The thing I didn't like about this was that it made the forms impossible to customize. It simply spits out the contents of the form ordered alphabetically and submits it to an email -- there was no way/difficult to check for required fields, customize the email that the form sends, change the order of the contents of the email, validate data, etc. Finally... I actually reached someone at GoDaddy that understood exactly what I was talking about. He didn't give me a pre-scripted answer. He said my php code was great. He looked at both accounts, my hosting and my clients hosting, they have their own acct and I just take care of it, and we found the problem. I am on Linux, they are on windows. So we changed them to Linux and upgraded a few things and now it should work by tomorrow. Thanks for suggesting that I call them. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 25, 2010 Report Share Posted February 25, 2010 Ah, cool. Glad you found the fix. Quote Link to comment Share on other sites More sharing options...
dgow13 Posted February 26, 2010 Author Report Share Posted February 26, 2010 Ah, cool. Glad you found the fix. I appreciate your help. I rely on this forum to find answers to a lot of questions I have... especially php since I am learning it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.