Web site
#1
hello guys anyone can help me, i search one website only for reggistration like generik terporly website.

#2
Fck nice release!

#3
wrong section

#4
lol , search button , is too easy to find or read section forum (releases-web based... to get help go to request and support)

#5


<?php

$conf['db']['server'] = '';
$conf['db']['user'] = '';
$conf['db']['pass'] = '';

$conf['db']['dsn'] = sprintf("mysql:host=%s;dbname=newproject_auth", $conf['db']['server'] );

try
{
$db = new PDO($conf['db']['dsn'], $conf['db']['user'], $conf['db']['pass']);
}
catch(PDOException $e)
{
die('Error connecting to the database');
}

function get_real_ip()
{
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"]))
return $_SERVER["HTTP_CF_CONNECTING_IP"];
else
return $_SERVER['REMOTE_ADDR'];

}

function isRegFlood()
{
global $db;
$ip = get_real_ip();

$dbh = $db->prepare("SELECT max(regdate) FROM bg_user WHERE regip = :ip");

$dbh->execute( array( ":ip" => $ip ) );

$result = $dbh->fetch();

if( $result == null)
return false;
else
{

$time = $result[0];
if( (time() - $time) < (60*5) )
return true;
else
return false;
}
}

function isUserExist($username)
{
global $db;

$dbh = $db->prepare("SELECT count(*) FROM bg_user WHERE user_id = :user_id");
$dbh->execute( array( ":user_id" => $username ) );

$result = $dbh->fetch();

if( $result[0] == 0 ) return false;
else return true;;
}

function strbtwn($string, $min, $max)
{
if(strlen($string) >= $min && strlen($string) <= $max)
return true;
else
return false;

}

echo '<h1>LCGenericName02 Temporary Server Account Registration</h1>';
echo '<hr />';

if(isset($_POST['action']) && $_POST['action'] == 'register')
{
if(!isset($_POST['username']))
echo 'please enter a username';
elseif(!strbtwn($_POST['username'], 4,15))
echo 'Username needs to be between 4 and 15 characters long';
elseif(!ctype_alnum($_POST['username']))
echo 'Username can only contain letters and numbers';
elseif(!isset($_POST['pass1']) || !isset($_POST['pass2']))
echo 'Please enter a password';
elseif(!strbtwn($_POST['pass1'], 5, 31))
echo 'Password needs to be between 5 and 31 characters long';
elseif($_POST['pass1'] != $_POST['pass2'])
echo 'The 2 passwords u entered dont match';
elseif( isUserExist($_POST['username']))
echo 'This username is taken already';
elseif( isRegFlood())
echo 'U can only register 1 account every 5 minutes';
else
{
$dbh = $db->prepare("INSERT INTO bg_user (user_id, passwd, regdate, regip) VALUES(:uname, :pass, :regdate, :regip)");
$dbh->bindParam(':uname', $_POST['username'], PDO:TongueARAM_STR);
$dbh->bindParam(':pass', md5($_POST['pass1']), PDO:TongueARAM_STR);
$dbh->bindParam(':regdate', time(), PDO:TongueARAM_INT);
$dbh->bindParam(':regip', get_real_ip(), PDO:TongueARAM_STR);

if($dbh->execute())
echo 'Account successfully created, u can now login';
else
{
echo 'Something wend wrong creating your account<br />Please contact a administrator';
print_r($dbh->errorInfo());
}

}

}
else
{
echo '
<form method="post">
<table>
<tr>
<td>Username</td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pass1" /></td>
</tr>
<tr>
<td>Password (again)</td>
<td><input type="password" name="pass2" /></td>
</tr>
<tr>
<td colspan="2">
<input type="hidden" name="action" value="register" />
<input type="submit" value="Register temp account" />
</td>
</tr>
</table>
</form>';

}

?>

 

This is the temp registration page from LCGN.

U will have to modify it yourself to match the gamigo system with the salt and stuff

 

#6

thx you very much wizated but i dont know how to do this you cant help ? i need on simple web site only for register ,

if you have any guide or link of any web site poste me pls thx you



Forum Jump:


Users browsing this thread: 1 Guest(s)