SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    upstate NY, USA
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem passing form variables

    I'm having a problem passing form variables (a text field and a hidden field) to the same form.

    Here is some sample code:
    <FORM ACTION="<?php echo $PHP_SELF ?>" method="post">
    <input type="text" name="first" value="john">
    <input type="hidden" name="test" value="hidden">
    <a href="view_cart.php?update=1">link to this page</a>
    </FORM>


    And the print test: echo
    "$first"; echo "$test";


    I can't pass any form data to itself. Can this be done?
    Help...
    Last edited by jtsmk; Nov 5, 2001 at 14:00.

  2. #2
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where is your submit button?
    such as
    <input type="submit" name="submit" value="Submit">

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    upstate NY, USA
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did get this to work with an input type=image (code below) instead of using a link, but I'm not clear on how it works.


    <input type='image' name='submit.update' value='1' src='images/update.gif' width=113 height=20 border=0>


    Then I tested for:
    if($submit.update)

    Last edited by jtsmk; Nov 5, 2001 at 16:49.

  4. #4
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have to submit a form for the variables to be created.

    all your doing is showing the form.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


Bookmarks

Posting Permissions

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