Jump to content

Page Redirection


mallard

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.