Register Coundown For Chatzone
Started on the old forum in March 2008 · view the original in the archive · old links redirect here
<?php
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
print '<?xml version="1.0" encoding="utf-8"?>'.
'<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"'.
' "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';
include "./ini.php";
$login=htmlspecialchars(stripslashes(trim($login)));
$login=substr($login,0,15);
$pass=htmlspecialchars(stripslashes(trim($pass)));
$pass=substr($pass,0,15);
$name=htmlspecialchars(stripslashes(trim($name)));
$name=substr($name,0,20);
$sex=htmlspecialchars(stripslashes(trim($sex)));
print '<card title="Registration">'.
'<p align="left">';
$query_users_login = @mysql_query("select * from `".$px.$utable."` where login='".$login."';");
$users_login = @mysql_fetch_array($query_users_login);
if(empty($login)) $error='Nickname Required!
';
if(empty($pass)) $error=$error.'Password Required!
';
if(empty($name)) $error=$error.'Please Enter Your Name!
';
if(empty($sex)) $error=$error.'What Are You Male Or Female!
';
if(preg_match("/[^\da-zA-Z-@#!_]+/",$login)) $error.='This Nick Already Exists!
';
if(preg_match("/[^\da-zA-Z_]+/",$pass)) $error.='Error!
';
///////////////////////////////////
$wins = "0";
$smilie = "";
$hidden = "";
////////////////////////////////////
$db_login = $users_login['login'];
if(empty($error))
{ if(strtolower($login) != strtolower($db_login))
{
$success = @mysql_query("insert into `".$px.$utable."` values(0,'$login','$pass','$name','$sex','$bday','$bmonth','$byear','','$live','$mobile','$operator','$email','$wapurl','$weburl','$icq','$about','',0,0,'','','','','','',0,0,0,'".time()."','".time()."','".getenv(REMOTE_ADDR)."','".getenv(HTTP_USER_AGENT)."','$wins','$smilie','$hidden','');");
if($success)
{
whowhere($id,'New Registered');
print "[b]".$login."[/b], Welcome to India-Wap! :)
";
print "<a href=\"index.php?\">Login Now</a>";
}
else
print "Database Error:
<a href=\"reg.wml\">Retry</a>";
}
else
{
print 'There Is An Error!';
print "
<a href=\"reg.wml\">Retry</a>";
}
}
else
{ print $error;
print "
<a href=\"reg.wml\">Retry</a>";
}
print '</p>';
print '<p align="center">';
print "".$lang['copy']."
";
print '</p></card></wml>';
@mysql_close();
?>
this is the register file in which i need register countdown thnks
I WAS BORNED INTELLIGENT BUT EDUCATION RUINED ME...!!!
You can do this in 2 way
-
Check the register time of the user in sql where the ip is the browsering ip. Use this information to know if the time is greater or or lest than 30 mins.
-
Create a new database call reg_time with field id reg_ip xptime //// Create a function to get the uip eg.
$uip = getuip();
When the user register you will insert the information in this table
$xp = time() + 60 * 30 // 30 mins
mysql_query("INSERT INTO reg_time SET xptime='{$xp}' ip='{uip}'");
in the registration file do this under this tages...
if(empty($login)) $error='Nickname Required!
';
if(empty($pass)) $error=$error.'Password Required!
';
if(empty($name)) $error=$error.'Please Enter Your Name!
';
if(empty($sex)) $error=$error.'What Are You Male Or Female!
';
if(preg_match("/[^\da-zA-Z-@#!_]+/",$login)) $error.='This Nick Already Exists!
';
if(preg_match("/[^\da-zA-Z_]+/",$pass)) $error.='Error!
';
do
$check = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM reg_time WHERE ip='{uip}'"));
if($check[0]>0){
$error.= "You Can't register because your ip is already registered in the last 30 mins";
}
on you global page do this to delete time if greater than 30 mins so users can register
$time = time();
mysql_query("DELETE FROM reg_time WHERE xp_time > '{$time}'");
HMMM I GOT IT WILL BE MORE SIMPLEIF TELL ME THE S.Q.L SOTHAT I CAN JUST PASTE THE S.Q.L CODE AND JUST PREES A BUTTON AND THE WORK IS FINISH SOOOOO PLZZZZ TELLL THAT I AM NEW IN CHATZONE SCRIPTS PLS......THNKS External image (may be gone)
I WAS BORNED INTELLIGENT BUT EDUCATION RUINED ME...!!!
HMMM I GOT IT IT WILL BE MORE SIMPLE IF TELL ME THE S.Q.L SOTHAT I CAN JUST PASTE THE S.Q.L CODE AND JUST PREES A BUTTON AND THE WORK IS FINISH SOOOOO PLZZZZ TELLL THAT I AM NEW IN CHATZONE SCRIPTS PLS......THNKS External image (may be gone)
I WAS BORNED INTELLIGENT BUT EDUCATION RUINED ME...!!!