Jump to content

Adding variables to URL


geenee

Recommended Posts

Ok, there may well be a very simple solution to this problem but I can't think of it so here it is..

 

I've got several pages on a web site, the first is the index.php the others are index.php?type=1, index.php?type=2 etc... each page lists items and when you click on an item it displays the item's info, the link(s) to display the item's info should be:

 

<a href='{$PHP_SELF}&pid={$row[pid]}'>Item Link</a>

 

this works fine on all the pages apart from index.php, as the link comes out as:

 

index.php&pid=1

 

whereas it should be

 

index.php?pid=1

 

What is the simplist way for the script to use ? instead of & if there is no variable already being send through the URL??

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/117820-adding-variables-to-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.