Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PHP Problem

  • 09-07-2005 7: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