http://www.example.com/?user=someone
This is the rightway to call a user profile, bcoz your users are stored in a database and if you want to retreive or store the details of the user. This way is much useful to pass the user value to another page, with that value some jobs are done in the loaded page.
http://www.example.com/someone/
In this case, you are giving the absolute path and a seperate page is needed for someone. Is not the case in above, any user details can be shown in a single page.
In this case,
http://www.example.com/Raja/
http://www.example.com/John/
http://www.example.com/Emily/
for every user you have to create a seperate webpage, Is it the way to create thousands of user to create thousands pages?
The above ? method is querystring which will further handle the programming logic in the loaded page
rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
Yeah, I Understood. I am not having more idea about that, anyway I will get you back with some inputs
rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
It's called friendly urls. It's done through mod_rewrite with apache. Search in php forum, as there have been many threads on this already. I haven't worked on it [url rewriting], so this is all I can say.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
But how about alternate ways of handling navigation? What are the most used techniques?
I am not really sure of your question. As far as I know, there is either
* long, dirty urls, like, http://www.somewebsite.com/edit.php?id=1234&key=xy&somevar=v
or
* friendly urls, like,
http://www.somewebsite.com/edit/1234/xy/v
I am not aware of any other navigation techniques.
Are some ways worse to handle navigation than others? Is the last mentioned way ineffective?
As long as you take good measures to sanitize user's inputs it's okay. For example,
<?php
//mysql connection
//get the page from the url, sanitize it with mysql_real_escape_string
$page = mysql_real_escape_string($_GET['page']);
// $page = home or report
switch($page) {
case "home":
//include/print home's contents
break;
case "report":
//include/print report's contents
break;
default:
//show error page
break;
}
In the above example, a user can only access to only 2 pages, "home" and "report". If he tries anything else, it will take him to the error page [the default case].
Cheers,
Naveen
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356