timm211 Posted July 20, 2010 Share Posted July 20, 2010 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 More sharing options...
ram4nd Posted July 20, 2010 Share Posted July 20, 2010 http://php.net/manual/en/function.header.php there is the right way to use it Link to comment https://forums.phpfreaks.com/topic/208323-redirect-not-working/#findComment-1088731 Share on other sites More sharing options...
AbraCadaver Posted July 20, 2010 Share Posted July 20, 2010 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; Link to comment https://forums.phpfreaks.com/topic/208323-redirect-not-working/#findComment-1088733 Share on other sites More sharing options...
timm211 Posted July 20, 2010 Author Share Posted July 20, 2010 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! Link to comment https://forums.phpfreaks.com/topic/208323-redirect-not-working/#findComment-1088750 Share on other sites More sharing options...
AbraCadaver Posted July 20, 2010 Share Posted July 20, 2010 The main thing is the 'Location:'. There are many possible headers, not just a redirect. Link to comment https://forums.phpfreaks.com/topic/208323-redirect-not-working/#findComment-1088754 Share on other sites More sharing options...
timm211 Posted July 20, 2010 Author Share Posted July 20, 2010 The main thing is the 'Location:'. There are many possible headers, not just a redirect. Whoops, that should have been obvious to me. I must have accidentally deleted it while I was trying to get rid of a prior declare headers error. Thanks Shawn! Link to comment https://forums.phpfreaks.com/topic/208323-redirect-not-working/#findComment-1088759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.