Jump to content

Hidden form field not passing on variable


fastrobby

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.