When I try to submit a form (testing it out) this is what I get. Im using Xampp which sets up php, mysql, etc for those not familiar with it. It sends everything fine to the database and there doesnt seem to be any trouble there. Anyone have any ideas? I took out my email address and substituted x's just to cut down on the spiders picking it out.
Now the thankyou.html page does not yet exist so Im not sure if that is the problem, if so that is easily corrected. Thanks for any help.
This is the error message I get:
Warning: Cannot modify header information - headers already sent by (output started at C:\Xampp\xampp\htdocs\phpform\use\ServiceRequest\process.php:56) in C:\Xampp\xampp\htdocs\phpform\use\ServiceRequest\process.php on line 67
This is line 56 in the process.php:
mail("xxxxx@xxxx.xxx","Service Request",$message,"From: SyntheticShield");
This is line 67:
header("Refresh: 0;url=http://www.syntheticshield.com/thankyou.html");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not familiar with Xampp so the errors are a bit foriegn to me. However, the "headers already sent" could mean that Xampp is confused by one of two things; the header section of the mail function (4th field, "From..."), or the header() function.
By the way, the header() function will result in a browser "page not found" error if the page does not exist. It is OK to run this way, but I suggest putting in a placeholder anyway to eliminate this as a possibility.
To debug this try removing either piece and try it again. I would first suggest you remove the header() function. Then I would remove the forth field from the mail() function. My guess is that it is the header() function but you'll have to do the testing as I have never used Xampp before.
Send me your process.php and form1.html if you would like me to test this on my system.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the delay Everett, went to lunch break and got held up. I'll give what you suggested a try and if that doesnt work then I'll send the files and go from there. Thanks again for your help. I wish I knew more right now. Some of it I can figure out but then some is just beyond what I know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I commented out the header() and all I got this time was failed to connect to mail server error:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Xampp\xampp\htdocs\phpform\use\ServiceRequest\process.php on line 57
Which I believe is a result of working in xampp and not on an actual server. Xampp is just an install package that installs PHP, Apache and MySQL all together already configured to work and such instead of installing them separately and having to edit the php.ini files and such. Its all done for you which just made more sense to me after setting all that up once individually. Saves a TON of time. (www.apachefriends.org) I believe is the address without looking.
Anyway, thanks Everett, once I get this uploaded I'll try it out again and if I have any problems that I can sort through I'll post up and see if you have any ideas. Thank you so much again for your help, I REALLY appreciate it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I try to submit a form (testing it out) this is what I get. Im using Xampp which sets up php, mysql, etc for those not familiar with it. It sends everything fine to the database and there doesnt seem to be any trouble there. Anyone have any ideas? I took out my email address and substituted x's just to cut down on the spiders picking it out.
Now the thankyou.html page does not yet exist so Im not sure if that is the problem, if so that is easily corrected. Thanks for any help.
This is the error message I get:
Warning: Cannot modify header information - headers already sent by (output started at C:\Xampp\xampp\htdocs\phpform\use\ServiceRequest\process.php:56) in C:\Xampp\xampp\htdocs\phpform\use\ServiceRequest\process.php on line 67
This is line 56 in the process.php:
mail("xxxxx@xxxx.xxx","Service Request",$message,"From: SyntheticShield");
This is line 67:
header("Refresh: 0;url=http://www.syntheticshield.com/thankyou.html");
Not familiar with Xampp so the errors are a bit foriegn to me. However, the "headers already sent" could mean that Xampp is confused by one of two things; the header section of the mail function (4th field, "From..."), or the header() function.
By the way, the header() function will result in a browser "page not found" error if the page does not exist. It is OK to run this way, but I suggest putting in a placeholder anyway to eliminate this as a possibility.
To debug this try removing either piece and try it again. I would first suggest you remove the header() function. Then I would remove the forth field from the mail() function. My guess is that it is the header() function but you'll have to do the testing as I have never used Xampp before.
Send me your process.php and form1.html if you would like me to test this on my system.
Sorry for the delay Everett, went to lunch break and got held up. I'll give what you suggested a try and if that doesnt work then I'll send the files and go from there. Thanks again for your help. I wish I knew more right now. Some of it I can figure out but then some is just beyond what I know.
I commented out the header() and all I got this time was failed to connect to mail server error:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Xampp\xampp\htdocs\phpform\use\ServiceRequest\process.php on line 57
Which I believe is a result of working in xampp and not on an actual server. Xampp is just an install package that installs PHP, Apache and MySQL all together already configured to work and such instead of installing them separately and having to edit the php.ini files and such. Its all done for you which just made more sense to me after setting all that up once individually. Saves a TON of time. (www.apachefriends.org) I believe is the address without looking.
Anyway, thanks Everett, once I get this uploaded I'll try it out again and if I have any problems that I can sort through I'll post up and see if you have any ideas. Thank you so much again for your help, I REALLY appreciate it.