redirect to a thankyou page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • humair77
    New Member
    • Feb 2008
    • 1

    redirect to a thankyou page

    I need to redirect to a thankyou page after a user submit form. I am new in PHP and trying to use header("Locatio n: thankyou.html") ; but it is going to thankyou page. Everything else seems to be working fine - Please help me out !!!


    <?php
    error_reporting (E_PARSE);
    define("ADMIN_M AIL", "jb@bwp.net ");
    define("HOST_NA ME", $_SERVER['HTTP_HOST']);
    define("PHP_SEL F", $_SERVER['PHP_SELF']);
    define('FORM_RE CIPIENT', 'webmaster@lena pebuilder.net') ;
    $isHideForm = false;
    if( $HTTP_POST_VARS["formmail_submi t"] ){
    header("Locatio n: thankyou.html") ;
    exit();
    }
    ?>


    <!-- Reminder: Add the link for the 'next page' (at the bottom) -->
    <!-- Reminder: Change 'YourEmail' to Your real email -->

    <?php

    $ip = $_POST['ip'];
    $httpref = $_POST['httpref'];
    $httpagent = $_POST['httpagent'];
    $customer_name = $_POST['customer_name'];
    $customer_email = $_POST['customer_email '];
    $customer_addre ss = $_POST['customer_addre ss'];
    $customer_city = $_POST['customer_city'];
    $customer_state = $_POST['customer_state '];
    $customer_zip = $_POST['customer_zip'];
    $customer_phone = $_POST['customer_phone '];
    $customer_email = $_POST['customer_email '];

    $todayis = date("l, F j, Y, g:i a") ;

    $message = " $todayis [EST] \n
    Name: $customer_name \n
    Address: $customer_addre ss \n
    City: $customer_city \n
    State: $customer_state \n
    Zip: $customer_zip \n
    Phone: $customer_phone \n
    ";

    $from = "From: $customer_email \r\n";

    mail("webmaster @lenape.net", $subject, $message, $from );
    ?>
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    Hi,
    Are you getting an error? if so what is the error message?

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Could you re-explain the problem please?

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        I don't understand this part of your thread:
        ..... and trying to use header("Locatio n: thankyou.html") ; but it is going to thankyou page .....
        what is that last 'thankyou' page??

        Ronald

        Comment

        • helraizer1
          New Member
          • Mar 2007
          • 118

          #5
          For the errors, try using

          error_reporting (E_ALL);

          ini_set("displa y_errors", true);

          That will give you any error that occurs.

          If you have header location as thankyou.html, it will go to the thankyou page, do you not think?

          Comment

          • nomad
            Recognized Expert Contributor
            • Mar 2007
            • 664

            #6
            Originally posted by helraizer1
            For the errors, try using

            error_reporting (E_ALL);

            ini_set("displa y_errors", true);

            That will give you any error that occurs.

            If you have header location as thankyou.html, it will go to the thankyou page, do you not think?
            you might want to think of a redirect section that will open the link above if it is True if it fails then it does something....
            it might look some thing like this
            // redirect to success page
            if ($success){
            code here;
            }
            else{
            some more code here;
            }



            nomad

            Comment

            Working...