rsammy Posted December 7, 2006 Share Posted December 7, 2006 i need help adding a BACK button in a php page. i just need to send control back to the previous pagethis is the code for a Reply button on the page:header("Location: compose.php?mess_id=".$_POST["mess_id"]. "&reply=".$_POST["reply"]. "&m1=".$_POST["m1"]."&d1=".$_POST["d1"]."&y1=".$_POST["y1"]."&m2=".$_POST["m2"]."&d2=".$_POST["d2"]."&y2=".$_POST["y2"]."&inboxcounter=".$_POST["inboxcounter"]."&sentcounter=".$_POST["sentcounter"]);I just need to add another button - Back button and transfer control back to the previous page. how do i do that? i know there is a code like javascript:window.history.back(-1) but, how do i incorporate it in this code.thanx in advance Link to comment https://forums.phpfreaks.com/topic/29763-need-help-with-back-button/ Share on other sites More sharing options...
legendx Posted December 7, 2006 Share Posted December 7, 2006 <a href="<?=$_SERVER['HTTP_REFERER']?>">Back</a>http://us3.php.net/manual/en/reserved.variables.phpHope that helps. Link to comment https://forums.phpfreaks.com/topic/29763-need-help-with-back-button/#findComment-136661 Share on other sites More sharing options...
rsammy Posted December 7, 2006 Author Share Posted December 7, 2006 [quote author=legendx link=topic=117677.msg480272#msg480272 date=1165464954]<a href="<?=$_SERVER['HTTP_REFERER']?>">Back</a>http://us3.php.net/manual/en/reserved.variables.phpHope that helps. [/quote]thanx for replying, legendx. but, can u help me more? how can i use ur statement in my code? i'll have to use it in header... Link to comment https://forums.phpfreaks.com/topic/29763-need-help-with-back-button/#findComment-136668 Share on other sites More sharing options...
legendx Posted December 7, 2006 Share Posted December 7, 2006 [code=php:0]header("Location: ".$_SERVER['HTTP_REFERER']);[/code] Link to comment https://forums.phpfreaks.com/topic/29763-need-help-with-back-button/#findComment-136686 Share on other sites More sharing options...
rsammy Posted December 7, 2006 Author Share Posted December 7, 2006 thanx sir! but, the button does doesnt show up! i mean... how do i make the button show up and make it work? still need help Link to comment https://forums.phpfreaks.com/topic/29763-need-help-with-back-button/#findComment-136694 Share on other sites More sharing options...
mansuang Posted December 7, 2006 Share Posted December 7, 2006 use javascript [code]<INPUT TYPE="button" onClick="location.href='<?=$_SERVER['HTTP_REFERER']; ?>'">[/code] Link to comment https://forums.phpfreaks.com/topic/29763-need-help-with-back-button/#findComment-136696 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.