hey guys am new here am currently trying to code my own forum but am stuck on the register page....am gonna post the pages and please see if you can help me ok...
this is the register form page
///////////////////////////////////
this is the other page after you have click register
///////////////////////////////////////////////////
////
Those are the pages first problem its not INSERTING in the sql thats the problem and the codes to show the password and username errors i dont know if they are coded properly please help me thanx!
this is the register form page
///////////////////////////////////
PHP Code:
<?php
require("con.php");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";
echo "<head>";
echo "<title>Wapmasters World & Portal</title>";
echo "<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />";
echo"<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"/>";
echo "</head>";
echo "<body>";
echo "<div align=\"center\" style=\"border:dotted 1px blue\">";
echo "<br/><small>".date("D, m d Y")."</small>";
echo "<br/>---<br/>Registration Form - Please Fill out all fields";
echo "</div>";
echo "<div>";
echo "<form method=\"post\" action=\"reg.php\">";
echo "<br/><br/>Wapmaster name:<br/> <input type=\"text\" name=\"username\" maxlength=\"14\"/><br/>";
echo "Password:<br/> <input type=\"password\" name=\"password\" maxlength=\"14\"/><br/>";
echo "Email(valid email): <br/> <input type=\"text\" name=\"email\" maxlenght=\"30\"/><br/>";
echo "<input type=\"submit\" value=\"Register\">";
echo "</form>";
echo "</div>";
echo "<div align=\"center\">";
echo "<img src=\"icons/home.gif\" alt\"+\"/> <a href=\"index.php\">[^Home^]</a>";
echo "</div>";
echo "<div align=\"center\" style=\"background-color:blue\">";
echo "© Wapmasters World & Portal 2010 - 2011 All Rigths Reserved";
echo "</div>";
echo "</body>";
?>
///////////////////////////////////////////////////
PHP Code:
<?php
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
require("con.php");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";
echo "<head>";
echo "<title>Wapmasters World & Portal</title>";
echo "<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />";
echo"<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"/>";
echo "</head>";
echo "<body>";
echo "<div align=\"center\" style=\"border:dotted 1px blue\">";
echo "<br/><small>".date("D, m d Y")."</small><br/>---<br/>";
$exist = mysql_num_rows(mysql_query("SELECT (*) FROM users where username='".$username."'"));
if ($exist > 0) {
print "Username already exist please try again!";
exit;
}
if(empty($username)){
$error = "Username Cannot be left empty!<br/>";
}
if(strlen($username) <4) {
$error = "Username should be 4 - 14 characters<br/>";
}
if(strlen($password) <4) {
$error = "Password should be 4 - 14 characters<br/>";
}
if($error)
{
echo "<img src=\"icons/notok.gif\"> $error";
}else{
echo "<img src=\"icons/ok.gif\"> Registerd Successfully<br/>---<br/>";
mysql_query("INSERT INTO SET users username = '".$username."', password = '".password."', email = '".$email."'");
echo "<a href=\"enter.php\" method=\"get\">[^Enter^]</a><br/>";
echo "</div>";
echo "<div align=\"center\" style=\"border:dotted 1px blue\">";
echo "© Wapmasters World & Portal 2010 - 2011 All Rights Reserved";
echo "</div>";
}
echo "</body>";
?>
Those are the pages first problem its not INSERTING in the sql thats the problem and the codes to show the password and username errors i dont know if they are coded properly please help me thanx!
Comment