xUSR Posted April 3, 2012 Share Posted April 3, 2012 Hey everyone. I am extremely new to PHP coding and I wanted to take a shot at making a basic mail form submission. I have done a lot of research and cannot get my test files to work. No e-mails get sent to me. I appreciate any help you can offer. Here are the following pages: http://www.insightguild.com/contactformpage.html http://www.insightguild.com/sendmail.php (coding is viewable when you navigate to this file) I am using Bluehost.com as my hosting server. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/ Share on other sites More sharing options...
NomadicJosh Posted April 3, 2012 Share Posted April 3, 2012 When you click on the Send Mail button, it goes to a file not found page. It is looking for the script here http://www.insightguild.com/cgi-bin/sendmail.php Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1333815 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 oops my mistake, fixed that dead link. Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1333820 Share on other sites More sharing options...
NomadicJosh Posted April 3, 2012 Share Posted April 3, 2012 So, is the sendmail.php file being parsed by php? Why the php code viewable? Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1333823 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 To be honest I am not sure why the code is viewable Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1333983 Share on other sites More sharing options...
Jessica Posted April 3, 2012 Share Posted April 3, 2012 I would assume you don't have PHP on the server, is this your only PHP file? Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334051 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 yes it is Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334080 Share on other sites More sharing options...
Jessica Posted April 3, 2012 Share Posted April 3, 2012 if you upload a file with this: <?php phpinfo(); ?> and browse to it, what do you see? Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334098 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 www.insightguild.com/phptest.php lot of info.... can you view this file? Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334105 Share on other sites More sharing options...
NomadicJosh Posted April 3, 2012 Share Posted April 3, 2012 Ok, so PHP is installed and working correctly on your server, but your sendmail.php file is not being parsed by php and is instead being looked at as some sort of text file. Do you have anything in the error logs that come up when accessing sendmail.php from the browser? Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334109 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 this is all I see in the error logs: [Tue Apr 03 13:29:56 2012] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored. [Tue Apr 03 13:29:57 2012] [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored. [Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [Tue Apr 03 13:29:58 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [ pid=27441 thr=140266441140192 file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-03 13:29:59.18 ]: Flushing all sinks (periodic action) [Tue Apr 03 13:29:59 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ [Tue Apr 03 13:29:59 2012] [error] [client 98.118.10.205] File does not exist: /usr/local/apache/htdocs/index.php, referer: http://box810.bluehost.com/~gearwork/ Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334111 Share on other sites More sharing options...
Jessica Posted April 3, 2012 Share Posted April 3, 2012 Are you using any kind of website creator program like Dreamweaver etc? If you open the sendmail.php file in notepad does it show <?php or something else? Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334116 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 I am actually creating it all through notepad, including the php files edit: just opened up sendmail.php to double check and it looks like it has been changed to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 1</title> </head> <body> <p><?php<br /> <br /> $emailSubject = 'Insight Application';<br /> $webMaster = '[email protected]';<br /> <br /> $emailField = $_POST['email'];<br /> $nameField = $_POST['name'];<br /> $phoneField = $_POST['phone'];<br /> $budgetField = $_POST['budget'];<br /> $travelersField = $_POST['travelers'];<br /> $newsletterField = $_POST['newsletter'];<br /> <br /> $body = <<<EOD<br /> <br><hr><br><br /> Email: $emailField <br><br /> Name: $nameField <br><br /> Phone Number: $phoneField <br><br /> Budget: $budgetField <br><br /> Newsletter: $newsletterField <br><br /> EOD;<br /> <br /> $headers = "From: @email\r\n";<br /> $headers .="Content=type: text/html\r\n";<br /> mail($webMaster, $emailSubject, $body, $headers);<br /> <br /> ?></p> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334119 Share on other sites More sharing options...
Jessica Posted April 3, 2012 Share Posted April 3, 2012 There's the problem. Did you use any other tool to create or upload the file? It looks like it got edited in the wrong format. Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334122 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 I changed it back, still no e-mail in my inbox though. when i submit the form data it just redirects me to sendmail.php, a blank page Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334123 Share on other sites More sharing options...
Jessica Posted April 3, 2012 Share Posted April 3, 2012 Progress! Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334128 Share on other sites More sharing options...
xUSR Posted April 3, 2012 Author Share Posted April 3, 2012 any idea why i am failing to receive an e-mail in my inbox upon hitting submit? Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334129 Share on other sites More sharing options...
xUSR Posted April 4, 2012 Author Share Posted April 4, 2012 thanks for the help guys, I figured it out. Apparently bluehost.com doesn't allow you to send php form mail to an e-mail address that does not reside on it's server. Once I tried it with the webmaster e-mail address it worked fine. Quote Link to comment https://forums.phpfreaks.com/topic/260231-php-form-mail-help/#findComment-1334281 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.