REGISTER COUNDOWN FOR CHATZONE NEEDED FROM WHICH ONE IP CAN REGISTER ONCE IN 300 SECONDS IN 300 SECONDS ONLY ..... THANKS ALLL
Register Coundown For Chatzone
Collapse
X
-
this is the register file in which i need register countdown thnksCode:<?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(); ?>
-
Guest
You can do this in 2 way
1. 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.
2. Create a new database call reg_time
with field
id
reg_ip
xptime
////
Create a function to get the uip
eg.
When the user register you will insert the information in this tableCode:$uip = getuip();
in the registration file do this under this tages...Code:$xp = time() + 60 * 30 // 30 mins mysql_query("INSERT INTO reg_time SET xptime='{$xp}' ip='{uip}'");
doCode: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! ';
on you global page do this to delete time if greater than 30 mins so users can registerCode:$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"; }
Code:$time = time(); mysql_query("DELETE FROM reg_time WHERE xp_time > '{$time}'");
Comment
-
Guest
Comment