Page 1 of 1

Shops id's

Posted: Thu Sep 14, 2006 10:49 am
by Nexchin
Hello!
I'm cooperating with the construction of a petsite and I've some doubts about the construction of shops, like, in the shops.php it would show an image with links to the Shop's id's, but my real question is, from the main page of the shops, shops.php, how would I do id's like shops.php?id=idnumber here? Thanks, I'd need a page .php to add the shops without having to acess my account in my host. Thanks :)

Posted: Thu Sep 21, 2006 3:56 am
by Benjamin
What? You can either manually create the URLs or write a script to. Either way you'll need to have script that reacts to those variables. Do you know PHP? Have you written any code? Do you have clear, concise example of what your trying to do?

Posted: Thu Sep 21, 2006 5:47 pm
by speedy33417
You're going to need a database if you want to add anything. Any variables passed will be destroyed as soon as your visitor closes the browser.

Once you have your database you want to pull out the data and save them in a variable: $shopid and $shopname.

Then your code would be something like this:

Code: Select all

echo "<a href=\"http://www.mysite.com/shops.php?shopid=" . $shopid . "\"><" . $shopname . "></a><br>" . "\n";
Then shops.php would start something like this:

Code: Select all

$shopid = $_GET['shopid'];
Hope this helps.