Page 1 of 1

get method

Posted: Wed Apr 02, 2008 7:46 am
by clarky08
Hi I am just starting with PHP and I was wondering if someone would be kind enough to help me. I want to use the get method to send a variable to the next page. I am making a website for football clubs and i have a database witht the following fields:

ClubID
ClubName
ClubManger

On the first page there is a list of clubs names. When you click on the clubs name I want it to bring you to the profile page of that club. So what i want is for when someone clicks on Arsenal, for example, their id number is sent onto the profile.php page and I can get the ClubName and ClubManager fields out of the database using the ClubID.

Thanks in advance,
Colm

Re: get method

Posted: Wed Apr 02, 2008 8:02 am
by aceconcepts
In the link that takes the user to the next page write the link as:

Code: Select all

 
echo='<a href="next_page.php?id=$club_id">Next</a>';
 
$club_id would obviously contain a valid club id value.

Re: get method

Posted: Wed Apr 02, 2008 8:03 am
by mchaggis

Code: Select all

 
<a href="profile.php?ClubID=<?=$ClubID?>">Arsenal</a>