debuitls Posted August 26, 2009 Share Posted August 26, 2009 hi I have defined a variable on a page that holds a get value from a previous page. $propid = $_GET["id"]; I'm trying to access that variable now on a third page. I thought I could just append the variable to the URL that goes to the third page like this. <form name="bid" method="get" action="processbid.php?$propid"> But the $propid value does not show up in the URL of the next page? I was just wondering if anybody could see where I'm going wrong? Or maybe if someone knows of a better way to get the variable onto the third page other than using get? I don't really want to use a session though. If anybody could suggest anything it would be great. Thanks Link to comment https://forums.phpfreaks.com/topic/171945-getting-a-php-variable-from-one-page-to-another/ Share on other sites More sharing options...
ILMV Posted August 26, 2009 Share Posted August 26, 2009 Instead, add this WITHIN your form tag <input type="hidden" name="propid" value="<?php echo($_GET['id']); ?>" /> Link to comment https://forums.phpfreaks.com/topic/171945-getting-a-php-variable-from-one-page-to-another/#findComment-906651 Share on other sites More sharing options...
debuitls Posted August 26, 2009 Author Share Posted August 26, 2009 Thanks ILMV. Much better way of doing it. Cheers. Link to comment https://forums.phpfreaks.com/topic/171945-getting-a-php-variable-from-one-page-to-another/#findComment-906695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.