Author Topic: noobie question  (Read 396 times)

0 Members and 1 Guest are viewing this topic.

Offline j1979Topic starter

  • Irregular
  • Posts: 6
    • View Profile
noobie question
« on: May 17, 2010, 04:18:49 PM »
hello all, i hope someone can help, i am trying to make a PHP variable from a hidden form variable.

the page already has the value i need and the correct value is displayed.

<span class='summary betrag_rechts'>
         <span id='summary_total'>total <span>&nbsp;".$this->currency."</span></span>
         <input type='hidden' name='tbclient[total]' value='total'>
         </span><br />

but i need the value of "total" as a $php type variable.  is this possible?

thanks

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: noobie question
« Reply #1 on: May 17, 2010, 06:38:55 PM »
This has what to do with Ajax?

If you already have an echo statement echoing your form (its VERY unclear from your snippet) then its simply....

Code: [Select]
<input type='hidden' name='tbclient[total]' value='$total'>

otherwise.....

Code: [Select]
<input type='hidden' name='tbclient[total]' value='<?php echo $total?>'>

Offline j1979Topic starter

  • Irregular
  • Posts: 6
    • View Profile
Re: noobie question
« Reply #2 on: May 18, 2010, 06:28:12 AM »
This has what to do with Ajax?

If you already have an echo statement echoing your form (its VERY unclear from your snippet) then its simply....

Code: [Select]
<input type='hidden' name='tbclient[total]' value='$total'>

otherwise.....

Code: [Select]
<input type='hidden' name='tbclient[total]' value='<?php echo $total?>'>

yes my post is perhaps a little unclear.  the original line of code works, and does have the echo statment.  what i want to do is capture the value of <input type='hidden' name='tbclient[total]' value='total'>.

i need this because i need to send a session variable in the $format. 

something like

session_start();
$total = <input type='hidden' name='tbclient[total]' value='total'>;
$_SESSION['paypal'] = $total ;