Results 1 to 2 of 2
April 9th, 2007, 01:42 PM #1
How to send Form data to a MySQL database creater?
Ok... I have 4 php files:
config.php opendb.php closedb.php create.php
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?
April 10th, 2007, 05:59 PM #2197Registered User
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">
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."