Forum Moderators: coopster
I want to make a web site that allows the user to enter two values: Name and Password.
Once the user press "Enter" or whatever, then those values should be saved into a database which is Mysql and the table name is my_test.
Anyone can give me the code for that?
You need a form, two textboxes and a submit button. The form method should be set to post and the action should be your mysql insert script.
The script will then connect to the db using mysql_connect [php.net] and then select the proper db (if needed) using mysql_select_db [php.net].
You can then build your query, something like
$sql = "insert into tablename values('$user','$pass')";
Then execute the query using mysql_query [php.net].
You can then send them off to some thank you page using header [php.net]