Curl-- no ERRORS Still not working!!

Discussion in 'PHP' started by cornetofreak, Aug 26, 2008.

  1. #1
    hey all i have this parser script and its not working on my server although it works perfect on localhost?? any ideas

    heres the script()
    
    <?php
    error_reporting(E_ALL);
    include ('conn.php');
    set_time_limit(5000);
    function grablinks($site)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_URL, $site);
        ob_start(); // prevent any output
        return curl_exec($ch); // execute the curl command
        ob_end_clean(); // stop preventing output
        curl_close($ch);
    
    }
    
    function pageget($page)
    {
            $data = grablinks("http://domain.com/pageg/$page");
            preg_match_all('/<a target=\"_blank\" href=\"(.*?)\">(.*?)<\/a><\/td>/si',$data, $subdata);
            $c = count($subdata[1]);
            $name = $subdata[2];
            $link = $subdata[1];
    		//echo "<pre>";
    		//var_dump($subdata);
    		//echo "<pre>";
    		//echo "<pre>Page: ".$page. "<br></pre>";
           $maxget = 50; // amount of downloads per page
    	         for ($e = 1; $e < $maxget; $e++) {
    			 	  // $split = preg_split("/\//",$link[$e]);
    			//print_r($name[$e] . "<br>".$link[$e]."<br>");
    		mysql_real_escape_string(mysql_query("INSERT INTO `step`.`get` (`id`, `url`, `name`, `type`, `site`) VALUES (NULL,'$link[$e]','$name[$e]','', '4');"));
        }
    
    }
    
    $pg = 30; // Pages -1
    for ($i = 1; $i < $pg; $i++) {
        pageget($i);
    	if ($i == $pg){die;
    	}
    
    }
    ?>
    
    PHP:
    and the server info is here

    http://www.litewarez.com/info.php

    any ideas?
     
    cornetofreak, Aug 26, 2008 IP
  2. lfhost

    lfhost Peon

    Messages:
    232
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    add echo curl_error($ch); into the curl code to see if that is causing your issues.
    Have you tried just echoing out the returned data to see if it is pulling back anything ?
     
    lfhost, Aug 26, 2008 IP
  3. cornetofreak

    cornetofreak Peon

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ill try that + i have tried returning the data in the function and still nothing going on .. thanks will try
     
    cornetofreak, Aug 26, 2008 IP
  4. cornetofreak

    cornetofreak Peon

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    na theres no errors being outputting for curl extension ! I'm puzzled :( anyone else have any ideas?
     
    cornetofreak, Aug 26, 2008 IP
  5. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Your server IP is banned from accessing the site.
     
    Dondon2d, Aug 26, 2008 IP
  6. Dman91

    Dman91 Peon

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    are you sure the preg_match actually returns something ?
     
    Dman91, Aug 27, 2008 IP