"Page?id=1" how to?

For discussions about game development that does not fit in any of the other topics.
Post Reply
User avatar
begood
Posts: 13
Joined: Fri Sep 09, 2011 11:23 am

"Page?id=1" how to?

Post by begood »

Hey,
That's me again. :D

Now I need to know, how to make pages like that: http://localhost/game/index.php?id=1

This is, what script should I use to when we click on a link appears in the same page a different content.

Sorry for the confusion, I can't explain my self. :?

Example: I have a table with things to buy in index.php and I want when we click buy it goes for a page index.php?id=1 where ID is the id of the product... and in that page appears another table, different from the first one with Name, Desc, Price, Quantity and Buy (again)... (the function to give the user the product he buy and take him money I know...)

One more time, sorry for the confusion :?

Regards,
begood
Image
User avatar
Ark
Posts: 427
Joined: Wed Jun 01, 2011 10:25 pm

Re: "Page?id=1" how to?

Post by Ark »

Ok let's say that the user wants to buy something...

Code: Select all

<a href ="index.php?id=$appleid">Buy an apple</a>
<a href ="index.php?id=$tomatoid">Buy a tomato</a>
<a href ="index.php?id=$orangeid">Buy an orange</a>
so when a user clicks the link it will have the link index.php?id=012345 <== whatever the product id is.

now in the same index.php put some code below...

Code: Select all

if (isset($_GET['id']))
{
/////   [b]show the table with name, Desc, Price, Quantity and Buy (again)[/b]
}

Something like that ;)
Hope it help
Orgullo Catracho
User avatar
begood
Posts: 13
Joined: Fri Sep 09, 2011 11:23 am

Re: "Page?id=1" how to?

Post by begood »

Hey Ark,

Thanks a lot! I'm gonna try, I say something when I finished the test.

Cumpz.
Image
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: "Page?id=1" how to?

Post by hallsofvallhalla »

make sure to put your questions in the appropriate forum. Like coding or beginner or advanced help.

Thanks!
User avatar
begood
Posts: 13
Joined: Fri Sep 09, 2011 11:23 am

Re: "Page?id=1" how to?

Post by begood »

Hey again,

The script works in prefection!! :D

Thanks!

@Hall - Sorry, I'm new arround here and I didn't know the right place where to put my questions. Next time I'll put them on the right forum.

Cumpz.
Image
Post Reply

Return to “General Development”