Shops id's

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Nexchin
Forum Newbie
Posts: 1
Joined: Thu Sep 14, 2006 10:41 am

Shops id's

Post 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 :)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post 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?
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

Post 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.
Post Reply