Moderators: OldWolf, re*s.t.a.r.s.*2
bhootnath wrote:or you can just remove the registration link on the login page .. change the name of the registration page and do it manually for all your members.. i know it is lot of work initially but may be clan leaders can divide the load...
Zippo wrote:Thank you for your reply in my otjher thread.
You login works great..... except one important thing for me.
Only members of my gameclan should be able to enter the chat.
How do I do that?
I know I can disable guests.
But how do I keep strangers out?
Grtz.
Peter
$question=TRUE; // TO show the for html , true or false
$clanText="Enter the clan secrect question!";// to tell them to answer
$clanAnwser="unreal tournament 2004";// here the secret question..
<?php
require_once('functions.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $rftitle; ?></title>
<link rel="stylesheet" href="login.css" type="text/css" />
</head>
<body>
<div id="register_form">
<form class="register_form" action="register.php" method="post">
<h5 class="welcome"><?php echo $rfH5title; ?></h5>
<span class="rform"><?php echo $rfnick; ?></span> <input type="text" name="username" />
<br />
<span class="rform"><?php echo $rfpass; ?><span> <input type="password" name="password" />
<br />
<span class="rform"><?php echo $rfrpass; ?><span> <input type="password" name="repassword" />
<br />
<span class="rform"><?php echo $rfmail; ?></span> <input type="text" name="email" />
<br />
<?php if($question){
echo "<span class='rform'>$clanText<span> <input type='text' name='clanpass' />";
echo "<br />";
}
?>
<?php echo $rfrfield; ?>
<input type="submit" value="Submit" />
<input type="hidden" name="submitted" value="true" />
<?php echo $rfp; ?>
<?php
// N_V- lets put all Post array in variables for easy understanding
$username=trim($_POST['username']);
$password=trim($_POST['password']);
$repassword=trim($_POST['repassword']);
$email=trim($_POST['email']);
$clanpass=trim($_POST['clanpass']);
if($_POST['submitted'] == "true")
{
if(empty($username))
{
echo '<p id="error">Please fill up the username field.</p>';
}elseif(empty($password)){
echo'<p id="error">Please fill up the password field.</p>';
}elseif(empty($repassword)){
echo'<p id="error">Please fill up the re/type field.</p>';
}elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){
echo '<p id="error">The email is not valid.</p>';
}
// N_V- check if password match, could also been done in the RegisterUser function
elseif($password != $repassword){
echo '<p id="error">The password doesnt match, retype it!</p>';
}elseif($clanpass != $clanAnwser){
echo '<p id="error">Wrong clan answer, sorry cant register..!</p>';
}else{
RegisterUser($username, $password, $email);
}
}
?>
<?php echo $phpfreechatlogo; ?>
</form>
</div>
</body>
</html>
OldWolf wrote:I unfortunately don't have time to go through the code right now, or install a test. But I did try the demo site and everything seems to work, nice job.
Demo available to test http://radioscatrachas.info/chat/phpfreechat/
Return to Contributions (v1.x)
Users browsing this forum: No registered users and 70 guests