Loading certain database records with html link? (PHP)

BigToque

Lifer
Oct 10, 1999
11,700
0
76
How can I set a website to load a certain database record on a page load when the page is opened with a link embedded in the site?

I have a page that lists a bunch of game recaps from my hockey team. I want to be able to click a link beside each game that loads up a new page that shows the recap for the game.

I see it all the time with something like:

http://www.domain.com/recap.php?=someID

how do you get the "someID" part into a variable when recap.php loads?

 

Templeton

Senior member
Oct 9, 1999
467
0
0
Using the $_GET superglobal associative array. If you access a page with:
page.php?foo=bar
then within the script, $_GET['foo'] will hold the string "bar"
 

BigToque

Lifer
Oct 10, 1999
11,700
0
76
Originally posted by: Templeton
Using the $_GET superglobal associative array. If you access a page with:
page.php?foo=bar
then within the script, $_GET['foo'] will hold the string "bar"

Thank you very much. That's what I needed.