Location: PHPKode > projects > Web-Analiser > view/set_cokie.php
<?php
         $est=0; $auntif=0;
         $est=file_exists("../admin/init_cokie.php");   
		 if ($est) require("../admin/init_cokie.php");
		 else $dbase = "q";
		 
  function error_mes($mes)
      {
	       $est=0;
	       $est=file_exists("../admin/error_set.txt");  
		   if ($est)
		    {
		      $info=filesize("../admin/error_set.txt"); 
			}
		   else
		   {
		     $fp = @fopen("../admin/error_set.txt","w+");
			  if ($fp)
			   {
			     fclose($fp);
		         $info=0; 
			   }	 
		   }	 
		   
		   if ($info>100000) $fp = @fopen("../admin/error_set.txt","w+");
      	   else $fp = @fopen("../admin/error_set.txt", "a");
		   if ($fp) 
		     {
				 fputs( $fp,$mes."\n");
	             fclose($fp);
			 }	

      } 

 if ($dbase!="q")
		{
           session_start();
	       $quere="select * from p_base";
		   
		   $mysql = @mysql_connect($host,$user,$password) or die (error_mes('Conect_'.$host));

           if(!$mysql) exit;

            $connect=$mysql;
            $base=trim($dbase);
			
            $mysql = @mysql_select_db($dbase) or die (error_mes('select-base_'.$dbase));
			
          if($mysql)
             {       

                 $result = @mysql_query($quere) or die (error_mes('quere_'.$quere));
                 if(!$result) exit;
             }     
          else exit;

            $nrows=mysql_num_rows($result);

		   if ($nrows>0)
		   {
		      $ro=mysql_fetch_array($result);
              $dbase=stripslashes($ro['name']);
              $host = stripslashes($ro['host_serv']); 
              $user = stripslashes($ro['user']);  
              $pass = stripslashes($ro['passw']);  
              $htab1=stripslashes($ro['tab1']);
              $view_table=stripslashes($ro['view']);
			  $graphics=stripslashes($ro['graphics']);
              $lan=stripslashes($ro['language']);   
	          $htab2=stripslashes($ro['tab2']);
			  $nline=$ro['nline'];
			 
			  
			   if (isset($_POST['password']) && isset($_POST['name'])) 
	                {
					   
					   if ($_POST['password']==$pass && $_POST['name']==$user)
					   {
						 SetCookie("admpassw",$user,date('U')+600,"/");	//êóêèñ àóíòèôèêàöèè
						 $auntif=1;
						 $_SESSION["userwapr"]=$user;
					   }	 
					}
			  else
			        {
                          if (!empty($_SESSION["userwapr"])) 
                           { 
							 if ($_SESSION["userwapr"]==$user)
							 {
							    $auntif=1;
							    $_SESSION["userwapr"]=$user;
							 }
						   }
					      elseif (isset($_COOKIE['admpassw']))
                           {
						     if ($_COOKIE['admpassw']==$user) 
							   {
								 SetCookie("admpassw",$user,date('U')+600,"/");	//êóêèñ àóíòèôèêàöèè
								 $auntif=1;
							   }	
						   }
						   
					}		
		 }			
		   else {$nrows=0;}
	
		}
else $nrows=0; 

//-------------
//$auntif=1;
//---------------

?>
Return current item: Web-Analiser