Hagbard Posted April 24, 2008 Share Posted April 24, 2008 is there any way in the header file to have the page go back two pages header ("location: index.php"); - will take you back to index and I know if I make an input button it can go back a page <input type=button value=\"Go Back to List\" onClick=\"history.go(-1)\"> | "; but is there any way to combine the two so that it will automatically go back a page? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted April 24, 2008 Share Posted April 24, 2008 Not sure with PHP. But you can do it with Javascript. <body onload="javascript: history.go(-1)"> From memory... Quote Link to comment Share on other sites More sharing options...
ryanhowdy Posted April 24, 2008 Share Posted April 24, 2008 try this header("Location: ".$_SERVER[HTTP_REFERER]); Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted April 24, 2008 Share Posted April 24, 2008 Thats back one page, not two... You wanted to go back two right? So not the last page you were at but the page before? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 24, 2008 Share Posted April 24, 2008 You could use sessions, then update them on every page. Quote Link to comment Share on other sites More sharing options...
Hagbard Posted April 24, 2008 Author Share Posted April 24, 2008 Yes the code will be put into a process page but I want it to go back to the page before the page that started the process. Now give me a second to reread my reply and make sure I said that right. lol But yes I need to go back 2 pages. Quote Link to comment Share on other sites More sharing options...
Hagbard Posted April 24, 2008 Author Share Posted April 24, 2008 I do have a sessions script already running. However if that came to it I could just create a separate process page for each and point it to the page I'm looking for. I have post 1 post 2 post 3 post 4 I could just create a process page for each one that points to its respected page. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 24, 2008 Share Posted April 24, 2008 <body onload="javascript: history.go(-2)"> That'll send them back two pages in their history, which might not be too reliable (they may have visited other pages in between)...You should store the page before the page in a session variable and redirect them like that. Quote Link to comment Share on other sites More sharing options...
Hagbard Posted April 24, 2008 Author Share Posted April 24, 2008 I set up the sessions. Thank you for your help everybody! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.