View Full Version : how they make pages like www.something.com/q=2312?

07-15-2008, 09:46 AM
php question : how they make pages like www.something.com/q=2312

and that number is the reference to a specific page
which is i think .. is the efficient for large website to handle its numerous pages..

how they made it .. i mean ... are those pages actually exist. like home.php and 2312.php ? i dont think the number indicates the actual page..

how they connect them . . and how. .. how ?thanks

* 6 hours ago
* - 3 days left to answer.

Additional Details

2 hours ago
can anyone show me some simple steps to it ? thanks

07-15-2008, 10:59 AM
Try google for apache search engine friendly urls (http://www.google.com/search?hl=en&q=apache%2Bsearch%2Bengine%2Bfriendly%2Burls&btnG=Search)

Oops.. I misread your post, go with what rafiki said :)

07-15-2008, 01:13 PM
$_GET['q'] would get the value of q which would be 2312 from there there is many ways to handle the code to do different things.

07-15-2008, 07:01 PM
so it would be a GET ..

can you show me a simple example that works like that ?
dynamic , multiple pages

07-15-2008, 07:27 PM
$page = $_GET['q'];

$page_array = array( 3123, 2132, 1231, 1233, 1232);
if(in_array($page, $page_array)){
include $page'.php';
include 'index.php';

Quick easy and simple....
There are better ways of doing it and more secure ways.

07-15-2008, 08:30 PM
so those number 3123, 2132, 1231, 1233, 1232 are actually pages / file in the folder?

it is not dynamically generated ? but they are real pages? that mean we just modify the name of the actual file?

07-15-2008, 08:36 PM
The number could also be an ID from a MySQL database. There are numerous ways to assign numbers to pages. Contact the site owner and find out how he/she is going about it.