We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,970 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

page.php?page=1,2,3,4,..inf.

I know how to catch an action from someone entering page.php and then set a default to page=1 and have the action for page=1 to load page=2, but how should I make page.php to catch 1,2,3,4,5,infinity so it keeps loading until the user closes the browser?


reloading can be done using
header("Location: page.php?page=n");
(where n = number)

catching empty action can be done like this
if (!isset($action) or $action=="") {
$action="page1";
}

catching page =1 can be done like this
if ($action=="page1") {
header("Location: page.php?page=2");
}

etc.

4
Contributors
4
Replies
1 Day
Discussion Span
9 Years Ago
Last Updated
7
Views
floris
Junior Poster
162 posts since Jan 2004
Reputation Points: 115
Solved Threads: 2
Skill Endorsements: 4

I'm confused what this does ... it keeps redirecting to page 1 and then page 2 and then page 3 ... never stopping in between? I'm lost how this would be useful. Sorry floris but it's 3:30 am here ;) !

Dani
The Queen of DaniWeb
Administrator
21,343 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 367
Skill Endorsements: 122

I'm confused what this does ... it keeps redirecting to page 1 and then page 2 and then page 3 ... never stopping in between? I'm lost how this would be useful. Sorry floris but it's 3:30 am here ;) !

We will put additional code and information in at random, pulled from a function.

floris
Junior Poster
162 posts since Jan 2004
Reputation Points: 115
Solved Threads: 2
Skill Endorsements: 4

What do you mean by "catching an action"? Is "action" a URL variable passed to a script? Do you want to reload/refresh the page according to an integer value of a URL variable?

samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
Skill Endorsements: 22
<?php
header("Location: page.php?page=".($_GET['page']+1));
?>
jayant
Junior Poster in Training
95 posts since Nov 2003
Reputation Points: 46
Solved Threads: 1
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0872 seconds using 2.71MB