Results 1 to 8 of 8

Thread: [RESOLVED]PHP retrieve textbox value

  1. #1

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    [RESOLVED]PHP retrieve textbox value

    is there a way to retrieve a textbox value with PHP ?

    for example...

    <input type=textbox value=1 name="box">

    is there a way to get the value of "box" into a PHP variable?
    Last edited by Osiris; Aug 20th, 2005 at 10:52 AM.
    ؊Ϯϊ

  2. #2
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: PHP retrieve textbox value

    yea in a php script type

    <?php

    echo $_POST['box'];

    ?>

    this sends the value of "box" to ur web browser. in order to process the form to the way u want it u could either use conditionals, etc...

  3. #3
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    Re: PHP retrieve textbox value

    You can access it through the $_POST superglobal:
    PHP Code:
    echo $_POST['box']; 
    {yak}

  4. #4
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: PHP retrieve textbox value

    in order to use $_POST the form method must be post u could also use form methof get and $_GET (get appends the information to the url and wen u call it it takes it straight from the url

  5. #5

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: PHP retrieve textbox value

    Quote Originally Posted by ninjanutz
    yea in a php script type

    <?php

    echo $_POST['box'];

    ?>

    this sends the value of "box" to ur web browser. in order to process the form to the way u want it u could either use conditionals, etc...
    But in order to do this you would need a form, a submit button and a change of url... what i was thinking of was getting the value of a textbox without changing the url and without having a form and without submitting anything. Is there a way?
    ؊Ϯϊ

  6. #6

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: [RESOLVED]PHP retrieve textbox value

    I don't know if there is a way since the values are client side and php is server side, but I ended up putting everything in a form and submitting it via submit button...

    thanks everyone
    ؊Ϯϊ

  7. #7
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: [RESOLVED]PHP retrieve textbox value

    yea i dun think its possible with a form

  8. #8
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: [RESOLVED]PHP retrieve textbox value

    without*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width