Thread: form help

    #1
  1. No Profile Picture
    tigertim
    Guest
    Devshed Newbie (0 - 499 posts)
    Please help me, I am using PHP and MySql and want to know how to take input from an html form and place it in my database.

    Thanks
    Tim
  2. #2
  3. No Profile Picture
    rod k
    Guest
    Devshed Newbie (0 - 499 posts)
    =============
    page1.html:

    <form action="page2.php3" method="post">
    <input type=text name="name">
    <input type=text name="sex">
    <input type=submit>
    </form>

    ============
    page2.php3:

    (assume you've connected to mysql and selected appropriate database)

    $result=mysql_query("insert into your_table values('$name','$sex')");
    if (!$result)
    {
    //an error occured... do something!
    exit;
    }

    // insert succeeded ... do something else

    ========

    HTH

Similar Threads

  1. sending form field data
    By bellcom in forum PHP Development
    Replies: 1
    Last Post: January 19th, 2004, 03:39 PM
  2. post/get - what the heck happened to my form?
    By deolmstead in forum Java Help
    Replies: 1
    Last Post: January 18th, 2004, 02:39 PM
  3. Form validation in NN4 when form is in a layer
    By sly001 in forum HTML Programming
    Replies: 1
    Last Post: August 2nd, 2003, 05:13 PM
  4. Replies: 6
    Last Post: July 10th, 2003, 05:44 PM
  5. multi page form validation
    By martincrumlish in forum PHP Development
    Replies: 2
    Last Post: December 19th, 2002, 09:21 AM

IMN logo majestic logo threadwatch logo seochat tools logo