1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Unable to parse url [How can I fix it]

Discussion in 'PHP' started by itdevil, Dec 5, 2006.

  1. #1
    Hi,

    I am using the "Link Harvester" Free tool from SEOBook.com (tools.seobook.com/link-harvester/#source). But i am getting the fallowing error at least 50x before the results show. Anyone have any clue how to fix it. My hosts PHP Version is 4.4.4

    any help with greatly appreciated.

    Thank You!

    Best Regards,
    ITDevil
     
    itdevil, Dec 5, 2006 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    open up backlinks.php and paste line 300 - 320 on here, and give us a link to the page that creates the error.....
     
    krakjoe, Dec 5, 2006 IP
  3. itdevil

    itdevil Well-Known Member

    Messages:
    632
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thank You for your reply. Here the code from 300 - 320

    $gamy->search_yahoo();
      $totalresults = $gamy->totals['msn'];
      $totalresults += $gamy->totals['yahoo'];
    } else {
      $gamy->search_msn();
      $totalresults = $gamy->totals['msn'];
    }
    
    foreach($gamy->search_results AS $value) {
      $parsed = parse_url('http://' . $value['url']);
      $host = $parsed['host'];
    
      if ((substr($host,-4,4) == '.edu') || (substr($host,-7,4) == '.edu') || (substr($host,-6,6) == '.ac.uk')) {
        $edu[$host]['links']++;
        if ($edu[$host]['page'] == '') $edu[$host]['page'] = $value;
        if ($edu[$host]['ip'] == '') $edu[$host]['ip'] = gethostbyname($host);
        $cblock = substr($edu[$host]['ip'],0,strrpos($edu[$host]['ip'],'.'));
        $edu_cblocks[$cblock]++;
      } else if ((substr($host,-4,4) == '.gov') || (substr($host,-7,4) == '.gov') || (substr($host,-4,4) == '.mil') || (substr($host,-7,4) == '.mil')) {
        $gov[$host]['links']++;
        if ($gov[$host]['page'] == '') $gov[$host]['page'] = $value;
      
    Code (markup):

    Thank You!
     
    itdevil, Dec 5, 2006 IP
  4. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #4
    well, without more information, it's going to be difficult to guess. ;)

    but probably because your url is empty??? from the message given, your url value is "http://" ???
     
    daboss, Dec 5, 2006 IP
  5. itdevil

    itdevil Well-Known Member

    Messages:
    632
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #5
    itdevil, Dec 5, 2006 IP
  6. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #6
    find

    start : 309
    
    foreach($gamy->search_results AS $value) {
      $parsed = parse_url('http://' . $value['url']);
      $host = $parsed['host'];
    
    Code (markup):
    replace

    start : 309
    
    foreach($gamy->search_results AS $value) {
      echo "<pre>";
      print_r($gamy->search_results);
      echo </pre>;
      exit;
      $parsed = parse_url('http://' . $value['url']);
      $host = $parsed['host'];
    
    Code (markup):
    and give me a link to the script, my server doesn't have domxml and so won't run it....
     
    krakjoe, Dec 5, 2006 IP
  7. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #7
    drum roll please ......
     
    krakjoe, Dec 5, 2006 IP
    itdevil likes this.
  8. itdevil

    itdevil Well-Known Member

    Messages:
    632
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #8
    The script is fixed now, Many Thanks to krakjoe for helping me out.

    And the fix is

    Change the line 309
    $parsed = parse_url('http://' . $value['url']);
    Code (markup):
    to

    $parsed = @parse_url('http://' . $value['url']);
    Code (markup):
     
    itdevil, Dec 5, 2006 IP
  9. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #9
    Reason :

    Not all $value 's have ['url'] set, the author of the script probably dev'd on a machine that supressed errors by default.....
     
    krakjoe, Dec 5, 2006 IP