Help me link my php page to mySQL?

MoreTasteFul

New member
Okay so I'm new to MySQL and PHP so far I have the simple form... that will get the data from my PHP page witch is not yet made because I don't know what code to use... My form page is like such



<html>

<body>

<form action="Unkown.php" method="post">

<center>

Name:<input type="text" size="25" name="fname"/>

</center>

<center>

Email:<input type="text" size="25" Name="email" />

</center>

<center>

Password: <input type="text" size="25" Name="Password"/>

</center>

<center>

<input type="submit"/></center>

</form>

</body>

</html>
And my database is set up...

Now I need to know what code to put on my Welcome.php page... to
get it to go to my database Moretastfull that has the table called People in it please help!!!
Okay so I'm new to MySQL and PHP so far I have the simple form... that will get the data from my PHP page witch is not yet made because I don't know what code to use... My form page is like such



<html>

<body>

<form action="Unkown.php" method="post">

<center>

Name:<input type="text" size="25" name="fname"/>

</center>

<center>

Email:<input type="text" size="25" Name="email" />

</center>

<center>

Password: <input type="text" size="25" Name="Password"/>

</center>

<center>

<input type="submit"/></center>

</form>

</body>

</html>
And my database is set up...

now i need to know the php code to link it to my php! this Is the registration not the log in!!!
Please give me your YIM or AIM!!
 
So in unkown.php:

<?php
$connect = mysql_connect("localhost","admin","abc123");
// Change "localhost" to your database path if necessary
// Change "admin" to your username
// Change "abc123" to your password
mysql_select_db("Moretastfull");
$name = htmlspecialchars($_POST["name"]);
$email = htmlspecialchars($_POST["email"]);
$password = htmlspecialchars($_POST["password"]);
// Gets the posted data and gets rid of possibly malicious data
$query = "INSERT INTO People (name, email, password) VALUES ($name,$email,$password)";
// Make sure you have columns name, email, and password. Change them if necessary.
mysql_query($query);
?>

Try that!
 
Back
Top