Page 1 of 1

Help Passing A Variable

Posted: Sun Jan 06, 2008 8:49 pm
by dgny06
OK...I know this is a very remedial question but I am stumped.

I have created an admin page that will edit a participant's information in a form. The user is found via a query that looks him/her up according to their ParticipantID. I am trying to pass that ParticipantID into the admin page though the URL (which works) but the problem is I do not know how to declare the variable on the admin page since I am not using a form on the previous page. I therefore can not use the normal $_Get["xxxxxxx"] method.

I am passing the variable on the first page by:

Code: Select all

<td><a href='edit_participant.php?ParticipantID=$ParticipantID'>$ParticipantID</a></td>
Thanks in advance for your help!

Posted: Sun Jan 06, 2008 9:25 pm
by RobertGonzalez
Then on the next page code something like this:

Code: Select all

<?php
$ParticipantID = isset($_GET['ParticipantID']) ? $_GET['ParticipantID'] : -1; // or some othe default value
?>

Posted: Sun Jan 06, 2008 10:15 pm
by dgny06
that worked.......thanks