[Help] register page

10/04/2010 20:11 alaaemad#1
hey guys

can some one talk to me how i can make register page like it

[Only registered and activated users can see links. Click Here To Register...]
10/04/2010 20:22 Jack Sparrow#2
Check out this

[Only registered and activated users can see links. Click Here To Register...]
10/05/2010 03:34 Arcо#3
PHP Code:
<form method="post" action="">

Username: <input type="text" name="username" value="" /><br/>
Password: <input type="password" name="pass" value="" /><br/>
Repeat Password: <input type="password" name="pass2" value=""/><br/>

<input type="submit" name="submit" value="Submit" />

</form>

<?php
$conn 
mysql_connect("localhost""root""Password");
$db mysql_select_db("databasename");


if(isset(
$_POST['submit']))
{
     if(isset(
$_POST['pass']) && $_POST['pass'] != "")
     {
          if(
$_POST['pass'] == $_POST['pass2'])
          {
               if(
strlen($_POST['pass']) > && strlen($_POST['pass']) < 32)
               {
                    
$sql "INSERT INTO `TableName` (Username, Password) VALUES ('".$_POST['ColumnName']."', '".$_POST['ColumnName']."')";
                    
$sql mysql_query($sql);
                    echo 
"Registered Successfully";
               } else {
                    die(
"Your password must be between 3 and 32 characters.");
               }
          } else {
               die(
"Your passwords do not match.");
          }
     } else {
          die(
"Please enter in a password.");
     }
}
?>
Give this a try.
10/05/2010 15:05 alaaemad#4
ty alot guys

but look

[Only registered and activated users can see links. Click Here To Register...]
10/05/2010 15:55 King_Arthur#5
Quote:
Originally Posted by alaaemad View Post
ty alot guys

but look
<Image>
Did you try to read the error messages before posting? It says access is denied, which means your username, password, or host is wrong. Fix that and then see what happens.

Arco's code is standalone, it doesn't use a config.php. If you have a config.php you have to edit his code to use it (which if you could do that you probably already would have known that) OR you can just edit the values on line 12 to the credentials you use in the order: host, username, password.
10/05/2010 16:54 Arcо#6
You need to edit these lines:
Code:
$conn = mysql_connect("localhost", "root", "Password");
$db = mysql_select_db("databasename");

$sql = "INSERT INTO `TableName` (Username, Password) VALUES ('".$_POST['ColumnName']."', '".$_POST['ColumnName']."')";
10/05/2010 19:51 alaaemad#7
wow thanks alot guys

all thing fine now