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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.