justAnoob Posted May 11, 2009 Share Posted May 11, 2009 I have a pagination setup with an update button on each page. Lets say I have 5 pictures to view, each one with its own page... And someone updates picture #2...After the update there is a header setting to keep them at the same page with a success message... header("location: http://www.xxxxxxxxxxxx.com/yyyyyyy.php"); The only problem is when they update picture #2 the URL is something like header("location: http://www.xxxxxxxxxx.com/yyyyyyy.php?pageno2"); What should I put in the header setting so it keeps them at the same picture after they update???? Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 I assume you use $_GET to get the page number or the page id or whatever. So in header, just add that part in. Quote Link to comment Share on other sites More sharing options...
justAnoob Posted May 11, 2009 Author Share Posted May 11, 2009 This is what gets the page number $_GET['pageno'] Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 Does the update button take the user to another page? Quote Link to comment Share on other sites More sharing options...
justAnoob Posted May 11, 2009 Author Share Posted May 11, 2009 Lets say the page that the user can look at their pics is called http://www.COOL.com/pics.php The pagination is setup for 1 picture at a time.... So when they click the next button,,, the URL reads as follows http://www.COOL.com/pics.php?pageno2 and so on.... When they do an update with picture number 2...... It takes them back to http://www.COOL.com/pics.php I would like it to keep them on pageno2..... Later down the road,,,, If they click on the delete button,,, I will have it take them to the picture that is previous to the one deleted.... But for now,,, I'm not worried about that. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 ... well I already know all that. My question is... when the user clicks the update button, what PHP file handles the update? Is it pics.php or some other file? Quote Link to comment Share on other sites More sharing options...
justAnoob Posted May 11, 2009 Author Share Posted May 11, 2009 It is another file update.php Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 Use SESSION to keep track of the last page the user has been to. Either that or send the pageno over to update.php. 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.