• 20-04-2015, 19:04:41
    #1
    Üyeliği durduruldu
    <?php
    	$linksTxtPath = "link1112.txt";
    	$imgTxtPath = "img11.txt";
    	
    	$linkData = file_get_contents($linksTxtPath);
    	$imgData = file_get_contents($imgTxtPath);
    	
    	$linkData = str_replace('\r', '', $linkData);
    	$imgData = str_replace('\r', '', $imgData);
    	
    	$links = explode("\n", $linkData);
    	$imgs = explode("\n", $imgData);
    	
    	
    	$resultLink = "";
    	$resultImg = "";
    	
    	if (count($links) > 0)
    		$resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);
    	
    	if (count($imgs) > 0)
    		$resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);
    	
    	
    	$result = array("link" => $resultLink, "durum" => "geldim");
    	
    	header('Content-Type: application/json');
    	echo(json_encode($result)); //, JSON_PRETTY_PRINT));
    
    
    ?>
    Burada kod link1112.txt dosyasından link çekerek ekrana yazdırıyor. Ben bunu kısaltma servisinden kısaltarak ekrana yazdırmak istiyorum. Kısaltma işlemini yapıcak kodlar ise aşağıda.

    //gets the data from a URL  
    function get_isgd_url($url)  
    {  
    	//get content
    	$ch = curl_init();  
    	$timeout = 5;  
    	curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);  
    	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);  
    	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);  
    	$content = curl_exec($ch);  
    	curl_close($ch);
    	
    	//return the data
    	return $content;  
    }
    
    //uage
    $new_url = get_isgd_url($resultLink);
    echo $new_url;
  • 20-04-2015, 21:12:46
    #2
    Levchin adlı üyeden alıntı: mesajı görüntüle
    <?php
    	$linksTxtPath = "link1112.txt";
    	$imgTxtPath = "img11.txt";
    	
    	$linkData = file_get_contents($linksTxtPath);
    	$imgData = file_get_contents($imgTxtPath);
    	
    	$linkData = str_replace('\r', '', $linkData);
    	$imgData = str_replace('\r', '', $imgData);
    	
    	$links = explode("\n", $linkData);
    	$imgs = explode("\n", $imgData);
    	
    	
    	$resultLink = "";
    	$resultImg = "";
    	
    	if (count($links) > 0)
    		$resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);
    	
    	if (count($imgs) > 0)
    		$resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);
    	
    	
    	$result = array("link" => $resultLink, "durum" => "geldim");
    	
    	header('Content-Type: application/json');
    	echo(json_encode($result)); //, JSON_PRETTY_PRINT));
    
    
    ?>
    Burada kod link1112.txt dosyasından link çekerek ekrana yazdırıyor. Ben bunu kısaltma servisinden kısaltarak ekrana yazdırmak istiyorum. Kısaltma işlemini yapıcak kodlar ise aşağıda.

    //gets the data from a URL  
    function get_isgd_url($url)  
    {  
    	//get content
    	$ch = curl_init();  
    	$timeout = 5;  
    	curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);  
    	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);  
    	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);  
    	$content = curl_exec($ch);  
    	curl_close($ch);
    	
    	//return the data
    	return $content;  
    }
    
    //uage
    $new_url = get_isgd_url($resultLink);
    echo $new_url;

    Sorunuzu doğru anladıysam eğer şu şekilde olması lazım, denemedim ama çalışması lazım

    <?php
    //gets the data from a URL  
    function get_isgd_url($url)  
    {  
    	//get content
    	$ch = curl_init();  
    	$timeout = 5;  
    	curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);  
    	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);  
    	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);  
    	$content = curl_exec($ch);  
    	curl_close($ch);
    	
    	//return the data
    	return $content;  
    }
    
    //uage
    	$linksTxtPath = "link1112.txt";
    	$imgTxtPath = "img11.txt";
    	
    	$linkData = file_get_contents($linksTxtPath);
    	$imgData = file_get_contents($imgTxtPath);
    	
    	$linkData = str_replace('\r', '', $linkData);
    	$imgData = str_replace('\r', '', $imgData);
    	
    	$links = explode("\n", $linkData);
    	$imgs = explode("\n", $imgData);
    	
    	
    	$resultLink = "";
    	$resultImg = "";
    	
    	if (count($links) > 0)
    		$resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);
    	
    	if (count($imgs) > 0)
    		$resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);
    	
    	
    	$result = array("link" => $resultLink, "durum" => "geldim");
    	
    	header('Content-Type: application/json');
    	(json_encode($result)); //, JSON_PRETTY_PRINT));
    $new_url = get_isgd_url($result);
    echo $new_url;
    
    ?>
  • 20-04-2015, 21:39:02
    #3
    Üyeliği durduruldu
    MoRTaLCoDeR adlı üyeden alıntı: mesajı görüntüle
    Sorunuzu doğru anladıysam eğer şu şekilde olması lazım, denemedim ama çalışması lazım

    <?php
    //gets the data from a URL  
    function get_isgd_url($url)  
    {  
    	//get content
    	$ch = curl_init();  
    	$timeout = 5;  
    	curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);  
    	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);  
    	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);  
    	$content = curl_exec($ch);  
    	curl_close($ch);
    	
    	//return the data
    	return $content;  
    }
    
    //uage
    	$linksTxtPath = "link1112.txt";
    	$imgTxtPath = "img11.txt";
    	
    	$linkData = file_get_contents($linksTxtPath);
    	$imgData = file_get_contents($imgTxtPath);
    	
    	$linkData = str_replace('\r', '', $linkData);
    	$imgData = str_replace('\r', '', $imgData);
    	
    	$links = explode("\n", $linkData);
    	$imgs = explode("\n", $imgData);
    	
    	
    	$resultLink = "";
    	$resultImg = "";
    	
    	if (count($links) > 0)
    		$resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);
    	
    	if (count($imgs) > 0)
    		$resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);
    	
    	
    	$result = array("link" => $resultLink, "durum" => "geldim");
    	
    	header('Content-Type: application/json');
    	(json_encode($result)); //, JSON_PRETTY_PRINT));
    $new_url = get_isgd_url($result);
    echo $new_url;
    
    ?>
    Çalışmadı malesef

    linkleri ekrana yazdıran kısım burası
    $result = array("link" => $resultLink, "durum" => "geldim");

    Linkleri txtden kısaltarak çektikten sonra kısa linki $resultLink bu değişkene koyması gerek.
  • 20-04-2015, 21:50:28
    #4
    Levchin adlı üyeden alıntı: mesajı görüntüle
    Çalışmadı malesef

    linkleri ekrana yazdıran kısım burası
    $result = array("link" => $resultLink, "durum" => "geldim");

    Linkleri txtden kısaltarak çektikten sonra kısa linki $resultLink bu değişkene koyması gerek.

    hocam denedim sorunsuz çalışıyor.

    kısa test için

    <?php 
    //gets the data from a URL   
    function get_isgd_url($url)   
    {   
        //get content 
        $ch = curl_init();   
        $timeout = 5;   
        curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);   
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);   
        curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);   
        $content = curl_exec($ch);   
        curl_close($ch); 
         
        //return the data 
        return $content;   
    } 
    
    $result="http//:www.google.com";
    $new_url = get_isgd_url($result); 
    echo $new_url; 
    ?>

    yada ben sizin dediğinizi halen anlamadım.
  • 20-04-2015, 21:53:34
    #5
    Üyeliği durduruldu
    MoRTaLCoDeR adlı üyeden alıntı: mesajı görüntüle
    hocam denedim sorunsuz çalışıyor.

    kısa test için

    <?php 
    //gets the data from a URL   
    function get_isgd_url($url)   
    {   
        //get content 
        $ch = curl_init();   
        $timeout = 5;   
        curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);   
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);   
        curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);   
        $content = curl_exec($ch);   
        curl_close($ch); 
         
        //return the data 
        return $content;   
    } 
    
    $result="http//:www.google.com";
    $new_url = get_isgd_url($result); 
    echo $new_url; 
    ?>

    yada ben sizin dediğinizi halen anlamadım.
    Hocam şimdi 2 parça kod var bu kısaltma için gerekli olan link çalışıyor fakat demek istesiğim şu diğer kod parçasında ise link txt den link çekiyor ekrana yazdırıyor fakat uzun link bu kısaltma kodunu diğer kodun içine entegre ederek uzun linki txtden çekerken kısaltıp ekrana öyle bastırıcak.

    Buradaki
    $result = array("link" => $resultLink, "durum" => "geldim");
    $resultLink değeri içine bastırması gerekli kısa linki.
  • 20-04-2015, 21:56:33
    #6
    <?php
    function get_isgd_url($url)
    {
    //get content
    $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
    $content = curl_exec($ch);
    curl_close($ch);

    //return the data
    return $content;
    }
    $linksTxtPath = "link1112.txt";
    $imgTxtPath = "img11.txt";

    $linkData = file_get_contents($linksTxtPath);
    $imgData = file_get_contents($imgTxtPath);

    $linkData = str_replace('\r', '', $linkData);
    $imgData = str_replace('\r', '', $imgData);

    $links = explode("\n", $linkData);
    $imgs = explode("\n", $imgData);


    $resultLink = "";
    $resultImg = "";

    if (count($links) > 0)
    $resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);

    if (count($imgs) > 0)
    $resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);


    $result = array("link" => $resultLink, "durum" => "geldim");
    $result = get_isgd_url($result);
    header('Content-Type: application/json');
    echo(json_encode($result)); //, JSON_PRETTY_PRINT));


    ?>

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 21:56:33 -->-> Daha önceki mesaj 21:55:48 --

    Bunu deneyin :
    <?php
    function get_isgd_url($url)   
    {   
        //get content 
        $ch = curl_init();   
        $timeout = 5;   
        curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);   
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);   
        curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);   
        $content = curl_exec($ch);   
        curl_close($ch); 
         
        //return the data 
        return $content;   
    }
    	$linksTxtPath = "link1112.txt";
    	$imgTxtPath = "img11.txt";
    	
    	$linkData = file_get_contents($linksTxtPath);
    	$imgData = file_get_contents($imgTxtPath);
    	
    	$linkData = str_replace('\r', '', $linkData);
    	$imgData = str_replace('\r', '', $imgData);
    	
    	$links = explode("\n", $linkData);
    	$imgs = explode("\n", $imgData);
    	
    	
    	$resultLink = "";
    	$resultImg = "";
    	
    	if (count($links) > 0)
    		$resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);
    	
    	if (count($imgs) > 0)
    		$resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);
    	
    	
    	$result = array("link" => $resultLink, "durum" => "geldim");
    	$result = get_isgd_url($result);
    	header('Content-Type: application/json');
    	echo(json_encode($result)); //, JSON_PRETTY_PRINT));
    
    
    ?>
  • 20-04-2015, 21:59:47
    #7
    Üyeliği durduruldu
    MoRTaLCoDeR adlı üyeden alıntı: mesajı görüntüle
    <?php
    function get_isgd_url($url)
    {
    //get content
    $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
    $content = curl_exec($ch);
    curl_close($ch);

    //return the data
    return $content;
    }
    $linksTxtPath = "link1112.txt";
    $imgTxtPath = "img11.txt";

    $linkData = file_get_contents($linksTxtPath);
    $imgData = file_get_contents($imgTxtPath);

    $linkData = str_replace('\r', '', $linkData);
    $imgData = str_replace('\r', '', $imgData);

    $links = explode("\n", $linkData);
    $imgs = explode("\n", $imgData);


    $resultLink = "";
    $resultImg = "";

    if (count($links) > 0)
    $resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);

    if (count($imgs) > 0)
    $resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);


    $result = array("link" => $resultLink, "durum" => "geldim");
    $result = get_isgd_url($result);
    header('Content-Type: application/json');
    echo(json_encode($result)); //, JSON_PRETTY_PRINT));


    ?>

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 21:56:33 -->-> Daha önceki mesaj 21:55:48 --

    Bunu deneyin :
    <?php
    function get_isgd_url($url)   
    {   
        //get content 
        $ch = curl_init();   
        $timeout = 5;   
        curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);   
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);   
        curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);   
        $content = curl_exec($ch);   
        curl_close($ch); 
         
        //return the data 
        return $content;   
    }
    	$linksTxtPath = "link1112.txt";
    	$imgTxtPath = "img11.txt";
    	
    	$linkData = file_get_contents($linksTxtPath);
    	$imgData = file_get_contents($imgTxtPath);
    	
    	$linkData = str_replace('\r', '', $linkData);
    	$imgData = str_replace('\r', '', $imgData);
    	
    	$links = explode("\n", $linkData);
    	$imgs = explode("\n", $imgData);
    	
    	
    	$resultLink = "";
    	$resultImg = "";
    	
    	if (count($links) > 0)
    		$resultLink = str_replace(array("\r\n", "\n", "\r"), '', $links[rand(0, count($links) - 1)]);
    	
    	if (count($imgs) > 0)
    		$resultImg = str_replace(array("\r\n", "\n", "\r"), '', $imgs[rand(0, count($imgs) - 1)]);
    	
    	
    	$result = array("link" => $resultLink, "durum" => "geldim");
    	$result = get_isgd_url($result);
    	header('Content-Type: application/json');
    	echo(json_encode($result)); //, JSON_PRETTY_PRINT));
    
    
    ?>
    "Error: Please enter a valid URL to shorten" böyle hata verdi.
  • 20-04-2015, 22:39:07
    #8
    Levchin adlı üyeden alıntı: mesajı görüntüle
    "Error: Please enter a valid URL to shorten" böyle hata verdi.
    hocam url nizde hata var ozaman.

    sayfada aktif olamadan birşey elimden gelmiyor.