fastrobby Posted September 20, 2012 Share Posted September 20, 2012 Hi, This is a shopping cart site. I have a variable $id being successfully brought to the next page from a hidden form field in my "product.php" page where I have established a variable $pid=$_POST['pid']; at the top of the page just in case ! <input type="hidden" name="pid" id="pid" value="<?php echo $id; ?>" /> On the next page "contact page" I have duplicated the hidden form field <input type="hidden" name="pid" id="pid" value="<?php echo $id; ?>" /> and again placed $pid=$_POST['pid']; at the top of the page. Once again it is passed successfully. On third page "cart.php" using the error checking code echo '<pre>'; print_r($_POST); echo '</pre>'; die; I find that pid=> is empty Code to receive the variable is if (isset($_POST['pid'])) { $pid = $_POST['pid']; $wasFound = false; $i = 0; Any clues ? It's got me stumped completely Any help would be very appreciated. I have uploaded the 3 files in question Thanks Robby 19047_.php 19048_.php 19049_.php Link to comment https://forums.phpfreaks.com/topic/268590-hidden-form-field-not-passing-on-variable/ Share on other sites More sharing options...
Jessica Posted September 20, 2012 Share Posted September 20, 2012 $pid and $id are not the same thing. Link to comment https://forums.phpfreaks.com/topic/268590-hidden-form-field-not-passing-on-variable/#findComment-1379493 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.