orr16875 Posted September 4, 2006 Share Posted September 4, 2006 I've wrote a mail.php file and i'm trying to send the form thru it. i don't get any errors, but since i did it, i don't get the form to the email (after being validated with JS ), and the user should get a "thankyou.html" page but i get a blank page instead. how should i do the "thankyou.html" page.there is the mail.php code:<html><body><? php$to = "info@inhomeestimates.com";$subject= $_REQUEST['Project:'];$headers .= 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$Date = $_REQUEST['Date'];$Project: = $_REQUEST['Project:'];$Description = $_REQUEST['Description'];$schedule = $_REQUEST['schedule'];$FirstName = $_REQUEST['FirstName'];$LastName = $_REQUEST['LastName'];$Address = $_REQUEST['Address'];$City = $_REQUEST['City'];$State = $_REQUEST['State'];$Zip = $_REQUEST['Zip'];$HomePhone = $_REQUEST['HomePhone'];$WorkPhone = $_REQUEST['WorkPhone'];$Cell = $_REQUEST['Cell'];$email = $_REQUEST['eMail'];$Estimates = $_REQUEST['Estimates'];$Budget = $_REQUEST['Budget'];$Advertising = $_REQUEST['Advertising'];$agree = $_REQUEST['agree'];mail("$to, $subject:, "from: $eMail");header("Location: http://www.inhomeestimates.com/thankyou.html");?> Link to comment Share on other sites More sharing options...
kvijayhari Posted September 4, 2006 Share Posted September 4, 2006 Hi , I have noticed a mail script with your needs, I'm already using that , take a try and it's also free and can be downloaded and can be changed to your needs.The url is Mail scriptTake a demo here Demo You can change the color and all others accoordin to ur needs. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 5, 2006 Share Posted September 5, 2006 mail("$to, $subject:, "from: $eMail");Take out that first quote. It should be like this:mail($to, $subject:, "from: $eMail");It doesn't redirect because there is a syntax error and it is not parsing the strings correctly. You probably have errors turned off on the server, or you would see the error instead of a blank page. This is how these two lines are being parsed (strings are in green):[mail("$to, $subject:, "from: $eMail");header("Location: http://www.inhomeestimates.com/thankyou.html");The error would have been a parse error because the string never ends, or a syntax error because it sees the "from" as a statement instead of a string. You also could have seen this error for yourself if you were using an editor with syntax highlighting instead of Notepad. Link to comment Share on other sites More sharing options...
aspnetguy Posted September 5, 2006 Share Posted September 5, 2006 what an awful color to try and read *blinded* Link to comment Share on other sites More sharing options...
justsomeguy Posted September 5, 2006 Share Posted September 5, 2006 I toned it down. I started with the color "green" and it was closer to black then green. Link to comment Share on other sites More sharing options...
orr16875 Posted September 7, 2006 Author Share Posted September 7, 2006 thank you justsomeguy,i've downloaded "phpED" and it's a lot easier that way. the only thing is i'm getting now a warning: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() Can i fix this within the script, and not on my computer (because what will happen in the client side? ) <?php$to = 'info@inhomeestimates.com';$subject= $_REQUEST['Project'];$headers .= 'From:etimate required'. "\r\n"; $Date = $_REQUEST['Date'];$Project = $_REQUEST['Project:'];$Description = $_REQUEST['Description'];$schedule = $_REQUEST['schedule'];$FirstName = $_REQUEST['FirstName'];$LastName = $_REQUEST['LastName'];$Address = $_REQUEST['Address'];$City = $_REQUEST['City'];$State = $_REQUEST['State'];$Zip = $_REQUEST['Zip'];$HomePhone = $_REQUEST['HomePhone'];$WorkPhone = $_REQUEST['WorkPhone'];$Cell = $_REQUEST['Cell'];$email = $_REQUEST['eMail'];$Estimates = $_REQUEST['Estimates'];$Budget = $_REQUEST['Budget'];$Advertising = $_REQUEST['Advertising'];$agree = $_REQUEST['agree'];mail($to, $subject ,$message, $headers);?> Link to comment Share on other sites More sharing options...
justsomeguy Posted September 7, 2006 Share Posted September 7, 2006 It's not a client error, it's a server error. PHP cannot connect to a mail server to send the mail. Chances are you are developing this at home and don't have a mail server installed on the server where PHP is running. If that's the case, and you are planning on moving this script online when you are finished (and off your personal computer), you can probably ignore this error, because the online server will have a mail server that PHP can use to send the mail. Or you can install your own SMTP server and try to send the mail from your test server, but your ISP might also be blocking the SMTP port, so the mail wouldn't be sent anyway. Link to comment Share on other sites More sharing options...
orr16875 Posted September 8, 2006 Author Share Posted September 8, 2006 ok, now it's all online: www.inhomeestimates.com and it's being hosted by "godaddy". there is a mail server - a webmail (webbased) email, so i guess there is no problem with the server any more (is there ?) but yet when i click "submit" on one of the forms (ac.html), i still get a blank page.you can see all the files on the server - but only the ac.html is linked to the mail.php (for now)help is needed and appreciated Link to comment Share on other sites More sharing options...
justsomeguy Posted September 11, 2006 Share Posted September 11, 2006 The code you posted above doesn't display anything, it just sends the mail. If you want it to display a thank-you or something, you will need to write that out. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now