The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 2 of 2

Thread: How to send Form data to a MySQL database creater?

  1. #1

    How to send Form data to a MySQL database creater?

    Ok... I have 4 php files:
    Now config holds all the MySQL connect data, opendb open the MySQL database, create puts the tables in the database, closedb closes the database.

    What I want to know is what php file I add a form to and how do i do this:
    A form with 4 inputs and a buttons (host, username, password and database) which will determine what details to use when loggin onto the MySQL db...

    How will I do this?
    My Photography

    K-Emmys-06: Best "Newbie"

  2. #2
    first off, not sure why u wanna be doing this, but thats ur part to think about...

    second, why do u have four files for such simple actions as opening ur connection, closing your connection etc.?

    once again, thats for u to think about too...

    to ur question:

    use an html form, with four <inputs>, each with a name that associates to what the data is, such as:
    <input type="text" name="host">
    Then, have a submit button (if you don't know how to add a submit button, I suggest you learn plenty about HTML and some basic PHP first before doing this, otherwise you could be opening your system up to some serious security flaws).

    The form will submit to config.php using a POST, and grab that data by in ur PHP file doing:

    $host = $_POST['host'];

    Then use the variable $host in your connection info to the DB.
    "First time it's a mistake, do it again and it's stupidity."

Thread Information

Users Browsing this Thread

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

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012