• 13-02-2016, 01:00:22
    #1
    Üyeliği durduruldu
    arkadaşlar merhaba php sitem var küçük bir uygulama. Login ekranı var şöyle bir sıkıntı var site refresh yaptığında tekrar login pass girmek zorunda kalıyoruz. buna beni hatırla ve cookie yapabilirmiyiz yardımcı olurmusunuz.

    <?php
    	error_reporting(0);
    	session_start();
    
    	## Mysql Host Bilgileri ##
    	$host = "94.73.150.142";
    	$user = "admins";
    	$pass = "123465";
    
    	$baglan = mysql_connect($host,$user,$pass) or die (mysql_Error());
    	$vt = mysql_select_db("enerjilogin", $baglan) or die (mysql_Error());
    
    	mysql_query("SET NAMES utf-8");
    	mysql_query("SET CHARACTER SET utf-8");
    	function yonlendir($url = false , $sure = 0){
    		if($url){
    			$sure = $sure * 500;
    			echo '<script type="text/javascript">setTimeout(function(){top.location.href = "'.$url.'";},'.$sure.')</script>';
    		}
    	}
    	if (empty($_SESSION["login"])) {
    		yonlendir('login.php');
    	}else {
    ?>
    <?php 
    Header("Refresh: 90;");
    
    function curl($address)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $address);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
        $icerik = curl_exec($ch);
        curl_close($ch);
        return str_replace(array("\n","\t","\r"), null, $icerik);
    }
    //$baglan = curl("http://212.156.113.178/pfc/table.html");
    preg_match_all('#<td style="width: 100px" align="right">(.*?)</td>#', $baglan, $data);
    foreach($data[1] as $veriler){
    $veriler = str_replace(" MW","",$veriler);
    	if($veriler < 10){$veriler = 0;}
    	$toplam = $veriler+$toplam;
    }
    //$toplam = ($data[4][0]+$data[4][1]+$data[4][2]);
    
    function curl2($address2)
    {
        $ch2 = curl_init();
        curl_setopt($ch2, CURLOPT_URL, $address2);
        curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch2, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
        $icerik2 = curl_exec($ch2);
        curl_close($ch2);
        return str_replace(array("\n","\t","\r"), null, $icerik2);
    }
    $baglan2 = curl2("http://195.175.74.50/pens.asp?UserId=0&Language=0&Device=eZtrend%20QXe");
    preg_match_all('#<td bgcolor="(.*?)"</td><td class="Table">(.*?)</td><td class="Table">(.*?)</td><td class="Table">(.*?)</td>#', $baglan2, $data2);
    foreach($data2[4] as $veriler2){
    	if($veriler2 < 10){$veriler2 = 0;}
    	$toplam2 = $veriler2+$toplam2;
    }
    
    ?>
  • 18-02-2016, 17:09:56
    #2
    Doğru login sayfası olduğuna emin misiniz?
  • 18-02-2016, 17:26:36
    #3
    Üyeliği durduruldu
    login.php sayfasını atmalısınız buraya