MyBB Community Forums

Full Version: Viewing Id from URL on Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
musicalmidget Wrote:
<input type="hidden" name="name" value="<?php echo $_GET['id']; ?>" />

If the above hidden field is submitted with a form then the recieving page will have the value of $_POST['name'] or $_GET['name'] (depending on the method used) asigned to the value that was $_GET['id'] on the form page.
Hi,
Thank you very much for your reply!

I added that code to my php file, but it does not work. Here is the error message I am getting:
Quote:Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in ***/invitationmanagement/index.php on line 69

Here is line 69 of my file:
<input type="hidden" name="invitecode" value="<?php echo $_GET['ic']; ?>">

My form is inside the following tags:
if ( mysql_num_rows( $result ) > 0 ){
  echo ' *FORM CONTENTS IS HERE* ';

Is there something else I can try? Thanks again!
If the form is in an echo statement using single ' marks, then try this code instead... Wink

<input type="hidden" name="invitecode" value="'.$_GET['ic'].'">

Obviously, I'm expecting there's more to the form than this, but it should look something like this in context...

echo '<form><input type="hidden" name="invitecode" value="'.$_GET['ic'].'"></form>';
musicalmidget Wrote:If the form is in an echo statement using single ' marks, then try this code instead... Wink

<input type="hidden" name="invitecode" value="'.$_GET['ic'].'">

Obviously, I'm expecting there's more to the form than this, but it should look something like this in context...

echo '<form><input type="hidden" name="invitecode" value="'.$_GET['ic'].'"></form>';
Thanks for your help! Smile
No worries. Smile
thanks kodaks
Pages: 1 2