View Full Version : PHP User System
Panther
25-10-2006, 05:29 PM
http://www.habbostudio.co.uk/members/register.php Cna someone help me everything is working except the register page? Any Help!
:Blob
25-10-2006, 05:33 PM
http://www.habbostudio.co.uk/members/register.php Cna someone help me everything is working except the register page? Any Help!
Post the code
Panther
25-10-2006, 05:39 PM
<?php
include ("config.php");
# include the config file
if ($_POST['Submit']){
$username = clean($_POST['username']);
$password = clean($_POST['password']);
$password_con = clean($_POST['password_con']);
$email = clean($_POST['email']);
$ip = clean($_SERVER['REMOTE_ADDR']);
$signup = time();
if (!$username | !$password | !$password_con | !$email){
# if any of the strings form the form are empty
echo 'You must fill in every field. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
}
else {
if ($password != $password_con){
echo 'Password fields did not match. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
}
else {
$username_test = "SELECT * FROM `users` WHERE username = '$username'";
$username_test = mysql_query($username_test);
if (mysql_num_rows($username_test) == 1){
echo 'Username is already being used. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
}
else {
$md5pass = md5($password);
$add = "INSERT INTO `users` VALUES ('', '$username', '$md5pass', '$email', '$ip', '$signup')";
mysql_query($add);
echo 'Success. You are now registered.<br />';
echo 'Login using the following information:<br />';
echo 'Username: '.$username.'<br />';
echo 'Password: '.$password;
}
}
}
}
else {
?>
<form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
Username:<br />
<input type="text" name="username">
<br />
Password:<br />
<input type="password" name="password">
<br />
Confirm Password:<br />
<input type="password" name="password_con">
<br />
E-mail:<br />
<input type="text" name="email">
<br />
<input type="submit" name="Submit" value="Register">
</form>
<?
}
?>
:Blob
25-10-2006, 05:48 PM
<?php
include ("config.php");
# include the config file
if ($_POST['Submit']){
$username = clean($_POST['username']);
$password = clean($_POST['password']);
$password_con = clean($_POST['password_con']);
$email = clean($_POST['email']);
$ip = clean($_SERVER['REMOTE_ADDR']);
$signup = time();
if (!$username | !$password | !$password_con | !$email){
# if any of the strings form the form are empty
echo 'You must fill in every field. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
}
else {
if ($password != $password_con){
echo 'Password fields did not match. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
}
else {
$username_test = "SELECT * FROM `users` WHERE username = '$username'";
$username_test = mysql_query($username_test);
if (mysql_num_rows($username_test) == 1){
echo 'Username is already being used. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
}
else {
$md5pass = md5($password);
$add = "INSERT INTO `users` VALUES ('', '$username', '$md5pass', '$email', '$ip', '$signup')";
mysql_query($add);
echo 'Success. You are now registered.<br />';
echo 'Login using the following information:<br />';
echo 'Username: '.$username.'<br />';
echo 'Password: '.$password;
}
}
}
}
else {
?>
<form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
Username:<br />
<input type="text" name="username">
<br />
Password:<br />
<input type="password" name="password">
<br />
Confirm Password:<br />
<input type="password" name="password_con">
<br />
E-mail:<br />
<input type="text" name="email">
<br />
<input type="submit" name="Submit" value="Register">
</form>
<?
}
?>
Theres no line 12 on that page? Its just a blank space.
Try pulling line 13 up 2 lines then re-upload and post the error
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.