Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

PHP Problem

  • 09-07-2005 08:45PM
    #1
    Closed Accounts Posts: 102 ✭✭


    Hi!

    I am really stuck on PHP problem...having never used it before my knowledge is extreemly limited - however its working ok with the exception of one field that i need to transfer to a piece of PHP script...


    This is the user input field on the form
    <input type="text" name="amount" value size="6" maxlength="50">


    This is from the php script file.
    $amount = echo("amount_input"); (need to get the amount entered on form to appear here)

    So that it can be inserted as the variable here...
    <input type=hidden name="AMOUNT" value="<?=$amount?>">

    I hope this makes some sense..

    I would appreciate any help as this has been driving me mad for ages and has become an urgent problem!

    Thanks

    Ka:-)


Comments

  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    echo() just prints something, and register_globals is probably turned off so you're probably looking for:

    $amount = $POST;

    If the form is sent via GET, change POST to GET. Or use REQUEST.

    Read the forms section of the introductory tutorial.

    adam


  • Closed Accounts Posts: 102 ✭✭ka


    Thank you ....
    Off to try all this now :-)

    Ka:-)


  • Closed Accounts Posts: 1,819 ✭✭✭K!LL!@N


    dahamsta wrote:

    $amount = $POST;

    It should actually be $_POST.
    The underscore is needed.

    You're also missing something from the input field it should be as follows: <input type="text" name="amount" value="" size="6" maxlength="50" />

    PHP is case sensitive, so when you have AMOUNT it should really be lower case to stay in keeping with what you have earlier.

    Killian


  • Closed Accounts Posts: 102 ✭✭ka


    Thanks Killian

    That worked a treat - this experience with PHP has me demented LOL! :rolleyes:


    Now back to issues with Realex.....the Amount must be 99900 for 999.00 - the Realex script will not accept changes - so is there a way I can PHP it to change the amount by adding two zeros?

    Ka:-)


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    K!LL!@N wrote:
    It should actually be $_POST.
    Well spotted Killian, sorry about that ka.

    ka, just multiply the amount by 100.

    $amount *= 100;

    (I've never actually used a combined operator for multiplication, but I presume it exists.)

    adam


  • Advertisement
  • Closed Accounts Posts: 102 ✭✭ka


    Whoo!!!!

    It works!! After weeks of problems there is hope that this will work!! LOL!!

    <note to self> Book course on PHP :D

    Thank you so much guys!!!

    Ka:-)


  • Closed Accounts Posts: 1,819 ✭✭✭K!LL!@N


    Cool.

    If you have anymore questions, fire away.

    Killian


Advertisement