Redirect after payment help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Krio07
Forum Newbie
Posts: 2
Joined: Fri May 29, 2009 11:58 am

Redirect after payment help!

Post by Krio07 »

Hello,


I've been trying to learn PHP and am attempting to finish my site that accepts payment. THe system works fine except that the confirmation page is ugly and instead of an echo on a white page i would like to redirect to a better looking site.

The user enters their card information and an if else statement begins

if - fail
//go to this site

else - sucess
// go to this site


What is the code for the site redirect inside of the if then?

Here is the current code- instead of echo "" i want a site redirect to a better looking page.. how can i do this??


THANK YOU!

Code: Select all

if(isset($arr['L_ERRORCODE0'])){
    $cnt=0;
    while(true){
        if(isset($arr['L_ERRORCODE' . $cnt])){
            echo "Error: " . $arr['L_ERRORCODE' . $cnt] . " - " .$arr['L_LONGMESSAGE' . $cnt];
        }else{
            break;
        }
        $cnt++;
    }
}else{
    echo "Succesful";
}
Last edited by Benjamin on Fri May 29, 2009 12:20 pm, edited 1 time in total.
Reason: Added [code=php] tags.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Redirect after payment help!

Post by Darhazer »

Code: Select all

header("Location: http://www.example.com/success.php");
exit;
Krio07
Forum Newbie
Posts: 2
Joined: Fri May 29, 2009 11:58 am

Re: Redirect after payment help!

Post by Krio07 »

thanks!
Post Reply