Default browser..

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

    Default browser..

    How to make the user may enter only with a browser .. If you try to get another browser to escape his notice that his nik protected and may enter default browser that is marked as the default..... I tried to do this .. but not work
    the SQL users I have added zastita CHAR 1..
    to index.php
    Code:
    else if($action=="zastita"){
    addonline(getuid_sid($sid),"HAPPY","index.php?action=$action");
    
    $pstyle = gettheme($sid);
        echo xhtmlhead("HAPPY",$pstyle);
    echo "<p align=\"center\">";
    
    $userwa = $uid;
    $zastita = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE id = '".$userwa."'"));
    if($zastita[0]==0){
            mysql_query("UPDATE ibwf_users SET zastita=1 WHERE id=$userwa");
            echo "Protection of your browser is activated.<br/>";
    }
    else if($zastita[0]==1){
            mysql_query("UPDATE ibwf_users SET zastita=0 WHERE id=$userwa");
            echo "Protection of yout browser is inactive.<br/>";
    
    }
    $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
        $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));  
        echo "<img src=\"http://coding-talk.com/images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/> <a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "HAPPY</a>";
      echo "</p>";
      echo xhtmlfoot();
    }
    to login.php
    Code:
    $zastita = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE name='".$uid."' AND browserm='".$brws."'"));
    if($zastita[0]==1){
    
    return true;
    
    }else{
    
    
      $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."'"));
      if($uinf[0]==0)
      {
        //Check for user ID
        echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Nik ne postoji<br/><br/>";
      }else{
        //check for pwd
        $epwd = ($pwd);
        $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));
    
        if($uinf[0]==0)
        {
          echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>pogresna lozinka<br/><br/>";
        }else{
          
          $tm = (time() - $timeadjust) ;
          $xtm = $tm + (getsxtm()*60);
          $did = $uid.$tm;
          $res = mysql_query("INSERT INTO ibwf_ses SET id='".($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");
          
          if($res)
          {
            $tolog=true;
            
    $sesx = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));
    echo "Na online je: <a href=\"index.php?action=online2\">$sesx[0]</a>  Forumasa<br/>";
    
            echo "<b>Uspesan login</b>!<br/>Pozdrav <b>$uid</b><br/>";
    
    
    echo "<img src=\"http://coding-talk.com/images/see_down.gif\" alt=\"*\"/><br/>";
    include "clock/include.php";
    echo "<br/>";
            $idn = getuid_nick($uid);
            
                $lact = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$idn."'"));
                 mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."' WHERE id='".$idn."'");
                 mysql_query("UPDATE ibwf_users SET lastact='".(time() - $timeadjust)."' WHERE id='".$idn."'");
          }else{
            //is user already logged in?
            $logedin = mysql_fetch_array(mysql_query("SELECT (*) FROM ibwf_ses WHERE uid='".$getuid_nick($uid)."'"));
            if($logedin[0]>0)
            {
              //yip, so let's just update the expiration time
              $xtm = (time() - $timeadjust) + (getsxtm()*60);
              $res = mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."' WHERE uid='".getuid_nick($uid)."'");
              
              if($res)
              {
                $tolog=true;
                //echo "Bookmark THIS page to avoid repeating the login proccess in the future<br/><br/>";
                echo "<b>Uspesan login!<br/>Pozdrav <b>$uid</b><br/>";
    
               
                
              }else{
                echo "<img src=\"http://coding-talk.com/images/point.gif\" alt=\"!\"/>Nemoguce logovanje, pokusaj kasnije<br/>"; //no chance this could happen unless there's error in mysql connection
                
              }
              
            }
            
          }
        }
      }
      
      if($tolog)
    
    {
    
      $sid = ($did);
        echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
    
    echo "<b>Udji i budi HAPPY</b></a><br/><br/>";
    echo "<img src=\"http://coding-talk.com/images/str1.gif\" alt=\"!\"/>  <a href=\"index.php?action=sexclub&amp;sid=$sid\">18+ Club</a>  <img src=\"http://coding-talk.com/images/str2.gif\" alt=\"!\"/><br/><br/>";
    
    
    
    
    
    echo "<b>Za laksi ulaz na forum skini</b><br/>";
    echo "<a href=\"http://www.opera.com/mini/download/generic/generic_advanced_midp_2/\">OPERU MINI</a><br/>";
    echo "Sacuvaj ovu stranicu kako bi izbegao/la stalno logovanje.<br/>";
            
    }else{
    echo "<br/><a href=\"index.php\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
    echo "HAPPY</a><br/><br/>";
    }
    return false;
    
    }
    So if I protect my nick with the browser and if someone try a different browser to enter my nick, he can not allow input...
    Last edited by srecnica; 06.10.09, 17:02.
    sigpichttp://happy.srecnica.com/web

    #2
    add something like in ur login check function

    PHP Code:
    $user_ip         $user["user_ip"];
    $user_browser $user["user_soft"];
    if((
    $user_browser!==$HTTP_USER_AGENT || $user_ip!==$ip)){
    mysql_query ("Update users set user_soft='"$HTTP_USER_AGENT."', user_ip = '".$ip."' WHERE id = '".$id."';");

    if (
    $user["ipbrosafety"]==1){
    // here ipbrosafety if its on then user logout
    }

    Comment


      #3
      Originally posted by Anshul View Post
      add something like in ur login check function

      PHP Code:
      $user_ip         $user["user_ip"];
      $user_browser $user["user_soft"];
      if((
      $user_browser!==$HTTP_USER_AGENT || $user_ip!==$ip)){
      mysql_query ("Update users set user_soft='"$HTTP_USER_AGENT."', user_ip = '".$ip."' WHERE id = '".$id."';");

      if (
      $user["ipbrosafety"]==1){
      // here ipbrosafety if its on then user logout
      }

      no.. not work
      sigpichttp://happy.srecnica.com/web

      Comment


        #4
        post here ur ifunction that checks if user is logged or not

        Comment


          #5
          $user = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE id = '".$uid."'"));

          $user_ip = $user["user_ip"];
          $user_browser = $user["user_soft"];
          if(($user_browser!==$HTTP_USER_AGENT || $user_ip!==$ip)){
          mysql_query ("Update users set user_soft='". $HTTP_USER_AGENT."', user_ip = '".$ip."' WHERE id = '".$id."';");

          if ($user["ipbrosafety"]==1){
          echo "<b><a href=\"logovanje.php\">Uloguj Se!</a></b>";
          }
          }
          ...and as you said ...
          sigpichttp://happy.srecnica.com/web

          Comment


            #6
            Again I ...Look, I've done this in login.php
            $tolog = false;
            $brws = explode("/ ",$HTTP_USER_AGENT);
            $ipscos = getip();
            $uip =$ipscos ;
            $ubr = $brws [0];
            $uinf = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE name='".$uid."'AND browserm='".$ubr."'"));
            if($uinf[0]==1)
            {
            $pstyle = gettheme($sid);
            echo xhtmlhead("$nazivsajta",$pstyle);
            echo "<p align=\"center\">";

            mysql_query("DELETE FROM ibwf_ses WHERE uid='".getuid_sid($sid)."'");
            echo "<br/><img src=\"http://coding-talk.com/images/notok.gif\" alt=\"x\"/>This Nick is protected...<br/>";
            echo "<small>You do not have permission to login this browser </small><br/>";
            echo "<small><a href=\"register.php\">Register</a></small><br/>";

            $nume = numebyip($ipscos);
            $text = "Ip-ul: $ipscos tried to get to Nik $nick![br/]Suspend of users: $nume / $ubr";
            $sql = mysql_query("SELECT id, name FROM ibwf_users WHERE perm='4'");
            while ($id = @mysql_fetch_array($sql)){
            mysql_query("INSERT INTO ibwf_obavestenja SET text='Warning!!![br/]".$text."', byuid='4', touid = '".$uid[0]."', timesent='".time()."'");
            }
            }else{

            $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."'"));
            if($uinf[0]==0)
            {
            //Check for user ID
            echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Nick does not exis<br/><br/>";
            }else{
            //check for pwd
            $epwd = ($pwd);
            $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));
            if($uinf[0]==0)
            {
            echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>wrong password<br/><br/>";
            }else{

            $tm = (time() - $timeadjust) ;
            $xtm = $tm + (getsxtm()*60);
            $did = $uid.$tm;
            $res = mysql_query("INSERT INTO ibwf_ses SET id='".($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");

            if($res)
            {
            $tolog=true;
            but when you protect your nick with option zastita = 1 (zastita=protected.. translate ;) ), then we are not allowed to log on and protected browser .. Where did I go wrong?...how to call the last entry in the database browser and to protect it recognize? to let me log in with that browser?....
            Last edited by srecnica; 08.10.09, 12:34.
            sigpichttp://happy.srecnica.com/web

            Comment


              #7
              anshul... heeelllpppp
              sigpichttp://happy.srecnica.com/web

              Comment


                #8
                first

                1. you want to disallow any other browser to login into account only the browser that is saved at login time ??

                or

                you want to show some message to user if his last login ip and browser didnt match wid his/her current ip and browser

                Comment


                  #9

                  1. you want to disallow any other browser to login into account only the browser that is saved at login time ??
                  ... yes, yes,yes, yes :D just want to ... they can log only protected browser...for example .. If you protect my Mozilla browser, they can log only with him ... and if you do not protect your browser to be able to log on with that browser ing...
                  with the latest code that I made a wrong thing done to me .. ban me enter protected browser instead we allow input from him
                  Last edited by srecnica; 09.10.09, 13:54.
                  sigpichttp://happy.srecnica.com/web

                  Comment


                    #10
                    Help..??? Anyone?
                    sigpichttp://happy.srecnica.com/web

                    Comment

                    Working...
                    X