# Solved: post a hidden value in php



## eric_sc (Sep 17, 2007)

Hey, I have a form that submits hidden values to a php file. in that file, i need to take the posted info and put it into a second form, which will be submitted when the page loads. i have the following code:

For the first form:

```

```
And the second file, checkout.php


```
<?php

$product_cost = $_POST['product_cost'];
$payment_mode = 'Fullpay';		//Change this line to change payment mode.
$storename = '1029328322';		//Change this line to change store name.

$mode_string = 'name=\'mode\' value=\'' . $payment_mode . '\'';
$chargetotal_string = 'name=\'chargetotal\' value=\'' . $product_cost . '\'';
$storename_string = 'name=\'storename\' value=\'' . $storename . '\'';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Untitled Document

 />
 />
 />
```
I renamed the body onload form to buyNowForm1 so it doesn't submit and you can review the code. when i view the source, everything has worked, but the line that calls the hidden field in $chargetotal_string doesn't show up!?

Any ideas, or am i unaware of some rule where if you pass hidden variables to php they remain hidden??

Eric


----------

