www.webdeveloper.com
Results 1 to 7 of 7

Thread: Need help with PHP Text box!

  1. #1
    Join Date
    Nov 2012
    Posts
    2

    Post Need help with PHP Text box!

    Well, to sum it up, I am not good at PHP. So, I was wondering if someone fills out a text box (Let's say they put in Waffles.) and then they click the submit button how can I make it so they go to http://www.example.com/edit.php?stuf...&thing=Waffles ?

  2. #2
    Join Date
    Oct 2012
    Posts
    55
    Better off putting this in the PHP section.

    Dan

  3. #3
    Join Date
    Jan 2009
    Posts
    3,346
    No PHP needed for the OP's request at all:
    Code:
    <form action="get">
    <input type="text" name="thing" value="Waffes" />
    </form>

  4. #4
    Join Date
    Nov 2012
    Posts
    2
    I just tried that and when I click the submit button nothing happens. Do I have to add something to the button's HTML? (Also, might I mention the form is on a different domain then the PHP page I am trying to link them to.)

  5. #5
    Join Date
    Mar 2012
    Posts
    1,112
    A text box is not a good idea for linking to other web pages.

  6. #6
    Join Date
    Jan 2009
    Posts
    3,346
    Quote Originally Posted by criterion9 View Post
    No PHP needed for the OP's request at all:
    Code:
    <form action="get">
    <input type="text" name="thing" value="Waffes" />
    </form>
    Typed that way too fast and didn't read over what I typed.
    Code:
    <form method="get" action="http://somedomain.com/edit.php">
    <input type="text" name="thing" value="Waffes" />
    </form>

  7. #7
    Join Date
    Dec 2012
    Posts
    52
    <html>
    <body>
    <?php $name = $_POST["fname"]; ?>
    <?php $age = $_POST["age"]; ?>
    Welcome <?php echo $name; ?>
    You are <?php echo $age; ?>
    </body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles