Jump to content

Redirect not working


timm211

Recommended Posts

Hey guys -

 

A friend outsourced some PHP coding to Pakistan, and then asked me to help implement it. The code allows an individual to preview and submit a bank check order online. It works well enough except for one part. After clicking "send order" on this page

 

http://chequesnow.ca/cheque/index.htm

 

it doesn't redirect to

 

http://chequesnow.ca/cheque/infoAfterSendEMail.htm

 

like I would have anticipated. Here's the code that I believe is handling this segment (sorry for the non-english, I don't understand it either):

 

$toAnother = $email;//So ova se praka porakata na mushterijata

if( $mail->send($to, $hdrs, $body) && $mail->send($toAnother, $hdrs, $body) )
{
        header("http://chequesnow.ca/cheque/infoAfterSendEMail.htm");
print "Porakata se prati uspeshno A i vo nea go imashe sledniov tip na fajl[".$fileAttachedType."]!";
}
else
{
    print "Porakata ne se prati";
} 

}

 

Can anyone tell me why a user isn't directed to the location specified in the header above, or how I could make that happen? And help would be greatly appreciated!

 

Thanks,

Tim

Link to comment
https://forums.phpfreaks.com/topic/208323-redirect-not-working/
Share on other sites

http://php.net/manual/en/function.header.php

 

there is the right way to use it

 

And things you should and shouldn't do after you use it:

 

header("Location: http://chequesnow.ca/cheque/infoAfterSendEMail.htm");
//print "Porakata se prati uspeshno A i vo nea go imashe sledniov tip na fajl[".$fileAttachedType."]!";
exit;

http://php.net/manual/en/function.header.php

 

there is the right way to use it

 

And things you should and shouldn't do after you use it:

 

header("Location: http://chequesnow.ca/cheque/infoAfterSendEMail.htm");
//print "Porakata se prati uspeshno A i vo nea go imashe sledniov tip na fajl[".$fileAttachedType."]!";
exit;

 

I'm still not exactly clear which parts of the above code fixed which problems...but I implemented the code above and it worked like a charm. Thanks so much!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.