Page 1 of 1

"Page?id=1" how to?

Posted: Fri Sep 09, 2011 2:27 pm
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

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

Posted: Fri Sep 09, 2011 3:39 pm
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

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

Posted: Fri Sep 09, 2011 4:11 pm
by begood
Hey Ark,

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

Cumpz.

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

Posted: Fri Sep 09, 2011 4:48 pm
by hallsofvallhalla
make sure to put your questions in the appropriate forum. Like coding or beginner or advanced help.

Thanks!

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

Posted: Fri Sep 09, 2011 6:05 pm
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.