mallard Posted July 3, 2007 Share Posted July 3, 2007 I'm building a site that has a notes/blog on it. I have the blog set up so that there will only be a certain number of posts per page. The posts are submitted via a simple form. I'm trying to figure out how to redirect the browser to the page that the post will show up on after it is submitted. Right now it just goes back to page one even though you're making a post that will display on page two, for example. I have this line in my code: header("Location: index.php?page=notes"); I'm thinking that I need to set up some kind of variable to pass the page info to so that it goes back to the corresponding page after the post is submitted. Something like this: header("Location: index.php?page=notes&pagenumber=some variable"); How would I set this up? Thanks for any help! Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted July 3, 2007 Share Posted July 3, 2007 I am not clear about ur q, but from my view if u have paging than i think u r using GET variable to pass data. Just call that GET variable in the post page and then use it as like: if($_GET['pagenumber']){ $page=trim($_GET['pagenumber'] } More code here..... Redirect link header("Location: index.php?page=notes&pagenumber=$page"); Hope this will help u. 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.