Register Coundown For Chatzone

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Register Coundown For Chatzone

    REGISTER COUNDOWN FOR CHATZONE NEEDED FROM WHICH ONE IP CAN REGISTER ONCE IN 300 SECONDS IN 300 SECONDS ONLY ..... THANKS ALLL

    #2
    Code:
    <?php
    header ("Content-type:text/vnd.wap.wml; charset=utf-8");
    print &#39;<?xml version="1.0" encoding="utf-8"?>&#39;.
    &#39;<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"&#39;.
    &#39; "http://www.wapforum.org/DTD/wml_1.1.xml">&#39;.
    &#39;<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>&#39;;
    
    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 &#39;<card title="Registration">&#39;.
    
    &#39;<p align="left">&#39;;
    
    $query_users_login = @mysql_query("select * from `".$px.$utable."` where login=&#39;".$login."&#39;;");
    $users_login = @mysql_fetch_array($query_users_login);
    
    if(empty($login)) $error=&#39;Nickname Required!
    &#39;;
    if(empty($pass)) $error=$error.&#39;Password Required!
    &#39;;
    if(empty($name)) $error=$error.&#39;Please Enter Your Name!
    &#39;;
    if(empty($sex)) $error=$error.&#39;What Are You Male Or Female!
    &#39;;
    if(preg_match("/[^\da-zA-Z-@#!_]+/",$login)) $error.=&#39;This Nick Already Exists!
    &#39;;
    if(preg_match("/[^\da-zA-Z_]+/",$pass)) $error.=&#39;Error!
    &#39;;
    
    ///////////////////////////////////
    $wins = "0";
    $smilie = "";
    $hidden = "";
    ////////////////////////////////////
    
    $db_login = $users_login[&#39;login&#39;];
    if(empty($error))
    {    if(strtolower($login) != strtolower($db_login))
        {
        $success = @mysql_query("insert into `".$px.$utable."` values(0,&#39;$login&#39;,&#39;$pass&#39;,&#39;$name&#39;,&#39;$sex&#39;,&#39;$bday&#39;,&#39;$bmonth&#39;,&#39;$byear&#39;,&#39;&#39;,&#39;$live&#39;,&#39;$mobile&#39;,&#39;$operator&#39;,&#39;$email&#39;,&#39;$wapurl&#39;,&#39;$weburl&#39;,&#39;$icq&#39;,&#39;$about&#39;,&#39;&#39;,0,0,&#39;&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;,0,0,0,&#39;".time()."&#39;,&#39;".time()."&#39;,&#39;".getenv(REMOTE_ADDR)."&#39;,&#39;".getenv(HTTP_USER_AGENT)."&#39;,&#39;$wins&#39;,&#39;$smilie&#39;,&#39;$hidden&#39;,&#39;&#39;);");
        if($success) 
          {
            whowhere($id,&#39;New Registered&#39;);
            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 &#39;There Is An Error!&#39;;
        print "
    <a href=\"reg.wml\">Retry</a>"; 
        }
    }
    else
    {    print $error;
      print "
    <a href=\"reg.wml\">Retry</a>";
    }
    print &#39;</p>&#39;;
    print &#39;<p align="center">&#39;;
    print "".$lang[&#39;copy&#39;]."
    ";
    print &#39;</p></card></wml>&#39;;
    @mysql_close();
    ?>
    this is the register file in which i need register countdown thnks

    Comment


      #3
      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.
      Code:
      $uip = getuip();
      When the user register you will insert the information in this table
      Code:
      $xp = time() + 60 * 30 // 30 mins
      mysql_query("INSERT INTO reg_time SET xptime=&#39;{$xp}&#39; ip=&#39;{uip}&#39;");
      in the registration file do this under this tages...
      Code:
      if(empty($login)) $error=&#39;Nickname Required!
      &#39;;
      if(empty($pass)) $error=$error.&#39;Password Required!
      &#39;;
      if(empty($name)) $error=$error.&#39;Please Enter Your Name!
      &#39;;
      if(empty($sex)) $error=$error.&#39;What Are You Male Or Female!
      &#39;;
      if(preg_match("/[^\da-zA-Z-@#!_]+/",$login)) $error.=&#39;This Nick Already Exists!
      &#39;;
      if(preg_match("/[^\da-zA-Z_]+/",$pass)) $error.=&#39;Error!
      &#39;;
      do
      Code:
      $check = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM reg_time WHERE ip=&#39;{uip}&#39;"));
      if($check[0]>0){
      $error.= "You Can&#39;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
      Code:
      $time = time();
      mysql_query("DELETE FROM reg_time WHERE xp_time > &#39;{$time}&#39;");

      Comment


        #4
        <span style="color:#0000FF">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 </span>

        Comment


          #5
          <span style="color:#0000FF">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 </span>

          Comment


            #6
            I said
            2. Create a new database call reg_time
            with field
            id
            reg_ip
            xptime[/b]

            Comment

            Working...
            X