# Pass php var as form value

**URL:** <https://forum.kirupa.com/t/pass-php-var-as-form-value/300298>\
**Category:** programming\
**Created:** [November 18, 2009, 9:21pm UTC](https://forum.kirupa.com/t/pass-php-var-as-form-value/300298 "2009-11-18T21:21:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashpipe](https://avatars.discourse-cdn.com/v4/letter/f/839c29/32.png) [@flashpipe](https://forum.kirupa.com/u/flashpipe)\
**Post date:** [November 18, 2009, 9:21pm UTC](https://forum.kirupa.com/t/pass-php-var-as-form-value/300298/1 "2009-11-18T21:21:51Z")

</div>

Not sure why this isn’t working, but I’m setting a variable in a form:

```auto
<input type="text" name="total_total" id="total_total" size="15" /> 

```

and updating it from another field:

```auto
<input type="text" name="num_reception" id="num_reception" size="15" value="0" onchange="document.myform.total_reception.value=75*parseInt(this.value);document.myform.total_total.value=75*parseInt(this.value);" /> 

```

and that works fine. However, when I try to pass that value to the next page, I get errors…

This works fine…

```auto
  <input type='hidden' name='pg_total_amount' value="50" /> 

```

This gives a “You are not authorized to view this page.” error:

```auto
<input type='hidden' name='pg_total_amount' value="<?php echo $total_total ?>" /> 

```

This gives an error that the value must a number be greater than 0:

```auto
<input type='hidden' name='pg_total_amount' value='total_total' /> 

```

Any ideas how to do this??

Thanks!!!
