shaunrigby Posted March 16, 2007 Share Posted March 16, 2007 Hi guys, i am an amateur at PHP and I am building a website for a client, however i seem to have a problem with the header part of the script. I have a simple form-mail script, and when the mail is sent the form relocates back to the home page, this is all fine and dandy, however the URL to the script processing page, still appears in the address bar; is this an IE7 fault? or is it actually PHP? is there a way around this? Cheers Guys Quote Link to comment Share on other sites More sharing options...
per1os Posted March 16, 2007 Share Posted March 16, 2007 If any script is re-directed with the Header("location:"); function it should change that in the address bar, it may be a bug in IE7. What version of PHP are you using? Quote Link to comment Share on other sites More sharing options...
tarun Posted March 16, 2007 Share Posted March 16, 2007 I Dont Think Its IE7 Beacuse I Just Ran A Simple Test In My IE7 Browser And Everything Seems Fine Have You Got A Link To That Page So I Can Test? Quote Link to comment Share on other sites More sharing options...
shaunrigby Posted March 16, 2007 Author Share Posted March 16, 2007 Yea, if you visit http://www.spacebarcomputers.com, and click on Contact us, fill random data into the form and press send, you will the be redirected to the index page, however the form processing page is still shown in the address bar. The script is below (note this is a BETA script) <?php //Polyglot feedback form processing //(c) 2007 Shaun Rigby @include_once 'includes/variables.php'; $formCheck = TRUE; $reasonCount = 0; $formFrom = $_POST['Name']; $formSubject = $_POST['Subject']; $formMessage = $_POST['message']; if($formFrom == NULL){ $formCheck = FALSE; $reasonCount++; $failureReason = "<li>You must give a name.</li>"; } if($formSubject == NULL){ $formCheck = FALSE; $reasonCount++; $failureReason = "<li>You must give a message subject.</li>"; } if($formMessage == NULL){ $formCheck = FALSE; $reasonCount++; $failureReason = "<li>You must type a message.</li>"; } //------------------------------------------------------------------------------------------// //If formCheck = true, send mail if($formCheck = TRUE){ //Compose Headers $headers = "From: Polyglot Website <$sendMailFrom>\r\n"; $headers .= "To: $sendMailName <$sendMailTo>\r\n"; $headers .= "Message-ID: <" . md5(date("GHs")) . "@" . $_SERVER['SERVER_NAME'] . ">\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: PHPMailer [version " . phpversion() . "]\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/plain\r\n"; //Compose Subject $subject = "You have received a message from your website."; //Compose Message $message = " Dear $sendMailName, $formFrom, has send you a message with the subject, $formSubject, the message is below; $formMessage"; //Send Mail $mailStatus = mail($sendMailAddress,$subject,$message,$headers); if ($mailStatus = TRUE){ header("Location:" . $websiteURL . "?pageid=9295"); } } Quote Link to comment Share on other sites More sharing options...
tarun Posted March 16, 2007 Share Posted March 16, 2007 I Got Forwarded To http://www.spacebarcomputers.com/thanks.shtml Is That Supposed To Happen... Quote Link to comment Share on other sites More sharing options...
shaunrigby Posted March 16, 2007 Author Share Posted March 16, 2007 sh!t, sorry the link was meant to be www.spacebarcomputers.com/polyglot/ Quote Link to comment Share on other sites More sharing options...
tarun Posted March 16, 2007 Share Posted March 16, 2007 I Think Its Working Mayby It Was Just A Temporary Error... :-\ Quote Link to comment Share on other sites More sharing options...
shaunrigby Posted March 16, 2007 Author Share Posted March 16, 2007 CRAZY! Possibly an IE cache problem? 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.