English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Im sure many of you good scripters have seen websites where the menu has different titles like HOME, SERVICES, CONTACT. but you can you link them by using and id like
yahoo.com/?p=100 brings it to HOME
yahoo.com/?p=101 brings it to SERVICES
yahoo.com/?p=102 brings it to CONTACT
this is all an example but i just want to learn how to do that???

2006-07-03 14:28:12 · 3 answers · asked by sobe50418 1 in Computers & Internet Programming & Design

3 answers

what you need to do something like that is set up a database where each p=x matches to a record like this:

recordId (p) | page
--------------------
100 | home
101 | services
.
.
.

then all you need is a script on the server that will take that information (in your example it would be an index.php or similar) and look up the page it actually wanted and redirect.

P.S. as a side note: Setting up your site in this manner is not very spider friendly. Most quality spiders (Yahoo and Google included) will follow a couple query string variable, but the more variables, the less likely they are to spider. They stop because the spiders realize its dynamic content and don't want to risk getting caught in an endless loop.

2006-07-03 16:16:14 · answer #1 · answered by John J 6 · 0 0

the link you are trying to say is what we call "QUERY STRING". In web programming, a query string contains values that is passed in a HTTP header and when sent to another web form, it can read the query string value to determine what type of information the user will get to see

the query string begins with a "?" followed by the query string item, then "=" and the value of the querystring item. subsequent query string will be followed by "&". a typical example will be like:

www.mywebsite.com/webform1.aspx?id=2&user=owner&color=red

scripting is not powerful and robust. you should use web programming languages instead like PHP, ASP.NET and JSP and combine it with a backend database like SQL, MYSQL and etc...

go to www.w3schools.com for more info on web programming

2006-07-04 04:26:37 · answer #2 · answered by Anonymous · 0 0

a href="http://www.targetdomain.com" target="yourtexthere

2006-07-03 21:36:26 · answer #3 · answered by -:¦:-SKY-:¦:- 7 · 0 0

fedest.com, questions and answers