aldrin151 Posted June 26, 2008 Share Posted June 26, 2008 Hello everyone...I'm trying to do a redirect after a certain condition to the previous page...I tried using header("Location: x.php"); , but there are parameters that I need to maintain and I want to avoid alot of coding... Anyway I want to use a javascript:history.go(-1); For example if ($fldtrappid == "1") { javascript:history.go(-1); } I guess this doesn't work since it requires a missing onclick or onblur or something to execute the script. How can I go upon going to the previous page using javascript:history.go(-1); in the code...? Thanks Link to comment https://forums.phpfreaks.com/topic/112112-php-previous-page-on-given-condition/ Share on other sites More sharing options...
haku Posted June 27, 2008 Share Posted June 27, 2008 How can I go upon going to the previous page using javascript:history.go(-1); in the code...? What? Link to comment https://forums.phpfreaks.com/topic/112112-php-previous-page-on-given-condition/#findComment-575690 Share on other sites More sharing options...
gijew Posted June 27, 2008 Share Posted June 27, 2008 Just an FYI but JS should NEVER be used as a primary source of navigation / redirection. Another FYI: document.location.href='page.html'; GL Link to comment https://forums.phpfreaks.com/topic/112112-php-previous-page-on-given-condition/#findComment-575693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.