Page 1 of 1

Question about links when using pagination

Posted: Wed Feb 18, 2004 8:48 am
by mikegotnaild
when adding myfile.php?page=$variable ex. acoustic.php?page=2 ... Is '2' an actual php page. Is it temporarly created? I dont understand this. Because when i run my script and try to go to page=2 "page 2" It says there is no such file.

Posted: Wed Feb 18, 2004 11:10 am
by tylerdurden
Unfortunately it's not as easy as that. You probably saw this on someone else's site? The "page=2" bit has to be handled by your own PHP script, e.g. for including the second part of an article or returning the second 20 (or soomething) results from a database search. Nothing automatic here.

Posted: Wed Feb 18, 2004 1:21 pm
by uberpolak
"2" is a variable you can use in your script to include a page. Something like this...

Note: This is horribly unsecure, don't use it, just an example.

Code: Select all

<?php

include($_GET['page'] . '.php');
//will find a page called '2.php' and inlcude it

?>