SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    header location doesn't work

    We have an e-commercial web site and we should redirect our customers to a result page according to the response of the bank.
    Although there is no error message, header("locationxxx.php"); doesn't work in any browser.
    Also this code works for other banks perfect without any error.
    But for one bank it doesn't work without any error.

    Some php.ini configuration:
    display_errors= on
    output_buffering= on

    Code:

    if($approved==true){
    header("location:".HTTPS_SERVER."/successful.php");
    exit();
    }
    else{
    header("location:".HTTPS_SERVER."/fail.php");
    exit();
    }


    after sending form with that bank, this code is just doing exit() by skipping header("locaiton") row.
    Thank you for your help.

  2. #2
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    Southwest Florida
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you echoed out $approved to see what, if anything, you're actually getting from the bank?

    How is approved coming in -- POST? GET? Do a print_r($_POST) and/or a print_r($_GET) to see what you're getting.

  3. #3
    SitePoint Enthusiast boroda's Avatar
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some php.ini configuration:
    What about error_reporting setting? Could it be NULL?

    Try to observe what is actually happens by using mozilla LiveHTTPHeaders plugin. You'll see is the correct header really sent to browser or not. You can download this plugun here:
    http://livehttpheaders.mozdev.org/

    HTH

  4. #4
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also check the PHP error log... you might not be seeing the error for one some reason or another through the browser, but if there is one, it'll be in the error log (assuming error_reporting is set correctly).

    Also, use the right forum next time.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •