Zenax
Active Member
- Messages
- 1,377
- Reaction score
- 4
- Points
- 38
Right, heres a small problem, that you smart PHP dudes, should know the answer too!
I am wanting to develop a dynamic website so that it runs from a database, using PHP.
So far, I have learnt how to do the connection, and have a rough idea of how to create the form. What I want is to be able to insert the data to the relevant database table, and then that should effect the page that reads the database, if I am right?!??
Code so far:
Form:
So I got connection script, I got form script i think :S, but what I need is how to get it from form to database using code above!!
Would you be so kind as to help me out?!?
Regards,
Zenax
I am wanting to develop a dynamic website so that it runs from a database, using PHP.
So far, I have learnt how to do the connection, and have a rough idea of how to create the form. What I want is to be able to insert the data to the relevant database table, and then that should effect the page that reads the database, if I am right?!??
Code so far:
PHP:
$username = "root";
$password = "*****";
$hostname = "localhost";
$dbname = "dyndb";
$conn = mysql_connection($hostname, $username, $password)
or die ("Sorry Cannot connect to the database server!");
$select = myql_select_db($dbname, $conn)
or die ("Sorry cannot connect to database!");
Form:
PHP:
<form method="post" action="">
Header Information:<br>
<textarea name="headerinfo" cols="60" rows="20"></textarea>
<input type="submit" name="Submit" value="Submit">
</form>
So I got connection script, I got form script i think :S, but what I need is how to get it from form to database using code above!!
Would you be so kind as to help me out?!?
Regards,
Zenax