...

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



likon
07-15-2008, 08: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

abduraooft
07-15-2008, 09: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 :)

rafiki
07-15-2008, 12: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.

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


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

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

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



http://www.php.net/include
http://www.php.net/in_array
Quick easy and simple....
There are better ways of doing it and more secure ways.

likon
07-15-2008, 07: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?

kbluhm
07-15-2008, 07: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum