I am a newbie with php and was hoping someone can help me out. I am creating my first dynamic site in php and have gotten stuck. I have one page with 100's of links. I need all these links to load the same page but I need the server to load it so that it is a different URL.

Example:

link - clicks through to index1.php?123
link - clicks through to index1.php?456
link - clicks through to index1.php?789

Thanks

Recommended Answers

All 7 Replies

examine mod_rewrite

I am a newbie with php and was hoping someone can help me out. I am creating my first dynamic site in php and have gotten stuck. I have one page with 100's of links. I need all these links to load the same page but I need the server to load it so that it is a different URL.

Example:

link - clicks through to index1.php?123
link - clicks through to index1.php?456
link - clicks through to index1.php?789

Thanks

Mh! and what have you done so far?

I am pretty much done with the site. I am just stuck on how to have many links go to the same page template with using a different URL for every page. I will look into mod-rewrite. If any one has any ideas on how to do this it would be much appreciated.

Member Avatar for diafol
index1.php?123

WHat does that mean? I thought querystring parameters had a parameter=value format.

Ok after doing a lot more research let me try to ask this in a different way. I think what i need to do is write a query string in URLs in php but have no idea where to begin. I have one index page with many links. All these links go to the same subindex page. The subindex page will need a unique URL for each link on the index page.

Ex.

index page links:

http://www.mysite.com/example1
http://www.mysite.com/example2
http://www.mysite.com/example3

When a user clicks on example1 it takes them to

http://www.mysite.com/example1/sample.php?id=

When a user clicks on example2 it takes them to

http://www.mysite.com/example1/sample.php?id=

I hope this makes more sense.

Thanks almostbob! Do you know of an easier way I could look into doing this and get the same results rather than going through 1000's of links and adding

.php?id=1
.php?id=2
.php?id=3
.php?id=4

and so on... to the end of all my links? much appreciated

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.