Professional Web Applications Themes

Problems using <FORM> tag... - PHP Development

Hi all - please help... using <FORM> HTML tag for user input and need to get get data from it and store in php variable... <input type="text" name="user_name" size="18" maxlength="16" class="input_left" tabindex="11" /> using the following to try and get user_name, but $user_name comes back blank in both cases... $user_name=$HTTP_POST_VARS['user_name']; $user_name=$_POST['user_name']; TIA...

  1. #1

    Default Problems using <FORM> tag...

    Hi all - please help...

    using <FORM> HTML tag for user input and need to get get data from it and
    store in php variable...

    <input type="text" name="user_name" size="18" maxlength="16"
    class="input_left" tabindex="11" />



    using the following to try and get user_name, but $user_name comes back
    blank in both cases...

    $user_name=$HTTP_POST_VARS['user_name'];

    $user_name=$_POST['user_name'];


    TIA



    Domestos Guest

  2. #2

    Default Re: Problems using <FORM> tag...

    Domestos wrote: 

    What is the full <FORM> tag?

    --
    Tony Garcia
    http://www.dslextreme.com/~tony23/


    Tony Guest

  3. #3

    Default Re: Problems using <FORM> tag...

    heres the html code...

    <?php
    $user_name=' ';
    require_once('includes.php');
    do_html_header('register');
    ?>
    <form action="register_new.php" method="post" enctype="text/plain"
    name="register">
    <fieldset><legend>Personal Details</legend>
    <p>
    <label for="user_name" class="label_left"> Login Username :</label>
    <input type="text" name="user_name" size="18" maxlength="16"
    class="input_left" tabindex="11" />
    </form>
    <?php
    ?>


    and here is the file register_new.php


    <?php
    require_once('includes.php');
    //create short variable names
    $user_name=$_POST['user_name'];

    echo $user_name;

    ?>


    And it leaves a blank screen !!!!


    Domestos Guest

  4. #4

    Default Re: Problems using <FORM> tag...

    I noticed that Message-ID: <voHre.23276$ntli.net>
    from Domestos contained the following:
     

    Standard advice, strip code down to the shortest snippet that shows the
    error.

    --
    Geoff Berrow 0110001001101100010000000110
    001101101011011001000110111101100111001011
    100110001101101111001011100111010101101011
    Geoff Guest

  5. #5

    Default Re: Problems using <FORM> tag...

    "Domestos" <net> kirjoitti
    viestissä:voHre.23276$ntli.net... 

    Dude! Where's My Submit button??
     

    Try debugging by making sure you get variables outside php in _some_ cases.
    Easy code in other words.
    Make page.php that you call with page.php?foo=bar
    contets of said page:
    <?php
    var_dump($_GET);
    var_dump($_POST);
    var_dump($HTTP_GET_VARS);
    var_dump($HTTP_POST_VARS);
    var_dump($_REQUEST);
    ?>

    ['foo']=bar should appear at least in three arrays: request, get and
    http_get_vars. If it doesn't, contact administrator.

    Next add to said page.php the following code
    <form method="POST">
    <input type="submit" name="foo" value="bar">
    </form>

    Click the button bar. Again ['foo']=bar should appear at least in three
    arrays: request, post and http_post_vars. If it doesn't, contact
    administrator.

    --
    "I am pro death penalty. That way people learn
    their lesson for the next time." -- Britney Spears

    com


    Kimmo Guest

  6. #6

    Default Re: Problems using <FORM> tag...

    hi all,

    don't you need () around the $_POST?

    as in .. $user_name = ($_POST['user_name']);

    <snip>
     [/ref]

    </snip>

    just wondering...

    p.j.

    (i'm relatively new to all of this stuff too.)


    insekta Guest

  7. #7

    Default Re: Problems using <FORM> tag...

    "insekta" <net.au> kirjoitti
    viestissä:42b055d8$0$11710$iinet.net.au... 


    No. Who ever gave you that idea?

    --
    "I am pro death penalty. That way people learn
    their lesson for the next time." -- Britney Spears

    com


    Kimmo Guest

Similar Threads

  1. form problems with CR/LF
    By Dan in forum Coldfusion - Getting Started
    Replies: 4
    Last Post: December 5th, 04:11 AM
  2. Replies: 4
    Last Post: September 24th, 12:34 PM
  3. Sub form problems
    By Tony in forum Microsoft Access
    Replies: 2
    Last Post: September 9th, 07:51 AM
  4. Problems using a log in form
    By TasmanDevil in forum Macromedia Dreamweaver
    Replies: 3
    Last Post: July 30th, 05:50 AM
  5. Form Problems
    By Leon Shaw in forum ASP.NET General
    Replies: 1
    Last Post: July 7th, 12:58 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139