i know its wrong section but i didn't know where to post

08/11/2011 15:37 HerpDerpNigga#1
its possible to make a register page in html?
yes i want it in html cause my site is in html
are the codes the same as
Code:
<?php
$my_connection = mysql_connect("127.0.0.1","root","password");
$my_database = mysql_select_db("blahblah");
?>
08/11/2011 22:04 bodayo69#2
Wtf , you can't do a register page only in html , you need to make 1 php page !
in your register.html put :
<form method="post" action="register.php" >
Username:<input type="text" name="username" /><br />
Password:<input type="password" name="password" /><br />
<input type="submit" name="sub" value="Register!" />
</form>

then make a page register.php :
<?php
include("connect.php");
$username = $_POST['username'];
$password = $_POST['password'];
if(isset($_POST['sub']))
{
if(!empty($_POST['username']))
{
if(!empty($_POST['password']))
{
mysql_query("ISERT INTO accounts(username, password) VALUES ('".$username."', '".$password."')");
echo "Account succesfuly registered !";
}
else
echo "You need to complete password field");
}
else
echo "You need to complete username field");
}
?>

Connect.php contains your mysql user , password , host etc ;


//this is a simple register page that i made right now ...you can improve it with email and other things