can anyone help me with the codes below;
<?php
if(isset($_POST['Submit'])){
//Check For Username
if(strlen($_POST['username'])>0){
$u = TRUE;
}else{
$u = FALSE;
$message .= '<p> You forgot to enter your username!</p>';
//$u =$_POST['username'];
}
//Check For Password
if(strlen($_POST['password1'])>0)
{
//$p = TRUE;
//$message .= '<p> You forgot to enter your password!</p>';
if($_POST['password1'] == $_POST['password2'])
{
$p = TRUE;
}else{
$p = FALSE;
$message .= '<p> Your Password did not match the confirmed password!</p>';
}
}else{
$p = FALSE;
$message .= '<p> Your Forget To Enter Password !</p>';
}
if($u && $p){
$query = "INSERT INTO usersystem (username,password) VALUES ('$u',PASSWORD('$p'))";
$result = mysql_query($query);
if($result){
echo '<p><b> You have been registered!</b></p>';
include ('template/footer,inc');
exit();
}else{
$message = '<p> You could not be registered due to a system error</p><p>'.mysql_error().'</p>';
}
mysql_close();
}else{
$message .= '<p> Please try again.</p>';
}
if(isset($message)){
echo '<font color="#FF0000">', $message, '</font>';
}
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<fieldset><legend>Enter Your Information in the form below:</legend>
<p><b> Username:</b> <input type="text" name="username" size="10" maxlength="20" value="<?php if (isset($_POST['username']))
echo $_POST['username'];?>"/></p>
<p><b> Password:</b> <input type="password" name="password1" size="20" maxlength="20"/></p>
<p><b> Confirm Password:</b> <input type="password" name="password2" size="20" maxlength="20"/></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Register" /></div>
</form>
I tried many time to post the data but nothing happen
Edited by Orjan, 24 October 2011 - 01:36 PM.
Add php tags to your code pieces!


Sign In
Create Account

Back to top









