Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default Help with VERY simple PHP +REP

    Hello,

    Basically I'm trying to make a form, where you enter a detail into a form field, and submit the form, it then shows a load of text/code in a textarea with the data you submitted at a certain point in the text. This is my code:

    Code:
    <?php
    if($_POST['submit'])
    {
        $port = $_POST['port'];
        echo "The text field: <textarea>blah blah blah $port blah blah</textarea>";
    }
    ?>
    <form action="index.php" method="post">
        <strong class="menu02">Your Port: </strong><br />
        <input type="text" name="name" />
        <br />
        <input type="submit" name="submit" value="Get Code" />
    </form>
    </div>
    For some reason, the bit that should be what they put in the port field of the form, appears as nothing in the textarea. What am I doing wrong, could someone correct me?

    Thanks in advance. +rep to the help that works.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  2. #2
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    your input must be named port in order for $_POST['port'] to be valid.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  3. #3
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    change
    HTML Code:
    <input type="text" name="name" />
    to
    HTML Code:
    <input type="text" name="port" />
    Coming and going...
    Highers are getting the better of me

  4. #4
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Thats what I just said.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  5. #5
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    Haha I can't believe I made that mistake! Thanks. +rep to both. edit: can't give craig sorry, it asks me to spread it around more first.
    Last edited by iUnknown; 08-03-2008 at 08:21 PM.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


Posting Permissions

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