38 users online (0 members and 38 guests)  


  Results 1 to 1 of 1

Related

  1. IE prob, ok otherwise...    Forum: CSS Forum
    Replies: 0
  2. site redesign... thoughts?    Forum: Show it off!
    Replies: 3
  3. Your Thoughts Please    Forum: Show it off!
    Replies: 3
  1. #1
    HMC's Avatar
    New User

    Status
    Offline
    Join Date
    May 2007
    Posts
    18

    Unhappy Any thoughts please on redirect prob.

    Would love your ideas on my problem, can't fathom it out.
    Basically, I have 2 websites, one has a php.script with separate contact.html form. The forms are filled in, passed to php and then user data results emailed. Also an automated email is sent to user. After clicking submit, they are redirected to a Thank You page (html). This is the problem, I've done this 3 times, on one website, it works great. On the other website, there are 2contact.forms and 2 php.scripts each doing the same as mentioned above( fill in, email sent, data sent by email, Thank You page redirect) it works fine on one page, but the other one just will not redirect to the Thank You page. I just can't fathom out why one is not working, is it because there are 2 on the same website? Should both contactforms.html point to the same script? The presently have their own? Bit of code below: The one below is actually the one that doesn't work, the others are written the same but do work, should I remove the bottom 3 lines??? Thanks in anticipation.

    Code:
    <?php blah blah blah
    //email body text
    blah blah blah
    ini_set("sendmail_from", " transport@mysite.com "); 
    
    mail($to,$subject,$message,$header,"From: transport@mysite.com");
    header( "Location: http://www.mysite.com/ThankYouforBooking.html" ); 
    
    $mime_boundary="==Multipart_Boundary_x".md5(mt_ran d())."x";
    $to = "$email";
    $subject = "Your Book Transport Submission";
    $headers = "From : My Site Ltd <transport@mysite.com>\r\n";
    $headers .="Reply-To: <transport@mysite.com>\r\n";
    $headers .="MIME-Version: 1.0\r\n";
    $headers .="Content-Type: multipart/alternative;boundary=\"{$mime_boundary}\"\r\n"; 
    $message = "--{$mime_boundary}\r\n";
    $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
    $message .= "Content-Transfer-Encoding: 7bit\r\n";
    $message .= "$name:\r\n";
    $message .= "We have received your Book Transport Form. We will contact you 
    shortly.\r\n";
    $message .="Thank you. \r\n";
    $message .= "--{$mime_boundary}\r\n";
    $message .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
    $message .= "Content-Transfer-Encoding: 7bit\r\n"; 
    $message .= "<html>\r\n";
    $message .= "<body style=\"font-family:Verdana, Verdana, Generva, sans-serif; font-size:14px; colour:#666666;\">\r\n";
    $message .= "$name:<br>\r\n";
    $message .= "<br>\r\n";
    $message .= "We have received your Book Transport Form. We will contact you shortly.<br>\r\n";
    $message .="<br>\r\n";
    $message .="Thank You.<br>\r\n";
    $message .="My Site Ltd\r\n";
    $message .= "</body>\r\n";
    $message .= "</html>\r\n";
    
    $message .= "--$mime_boundary--\r\n";
    
    $mail_sent = @mail ($to, $subject, $message, $headers);
    echo $mail_sent ? "Thank you for your submission, we will contact you shortly." : "Mail failed. Please use your browser back button and try again.";
    ?>
    Last edited by vinyl-junkie; 11-03-2007 at 11:58 AM. Reason: Added code tags



Tags for this Thread