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! Link to comment https://forums.phpfreaks.com/topic/58180-page-redirection/ 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. Link to comment https://forums.phpfreaks.com/topic/58180-page-redirection/#findComment-288553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.