File grabber error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    File grabber error

    coders plz check demo http://wapcult.com/test/a n found error

    PHP Code:
    <?php
    $file
    =file_get_contents('http://mobitamilan.net/download/software/?'.$_SERVER['QUERY_STRING']);
    $file=preg_replace('|<head>(.*?)</head>|is','<link rel="stylesheet" href="http://wapcult.com/style.css" type="text/css"/><title>::'.WApCuLT.'::</title></head>',$file);
    $file=preg_replace("|<div class='top'>(.*?)</div>|is","",$file);
    $file=preg_replace('|<a href="http://wapcult.com(.*?)</a>|is','',$file);
    $file=str_replace('_script/''http://mobitamilan.net/download/software/_script/',$file);
    $file=preg_replace("|<center>Powered by:(.*?)</center>|is","<center>Design by:<a href='http://wapcult.com/contact.php'>sahzada</a></center>",$file);

    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/file.gif" alt=".sisx" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/file.gif" alt=".sisx" /> <a href="http://mobitamilan.net/download/software/',$file);
    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/jar.png" alt=".jar" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/jar.png" alt=".jar" /> <a href="http://mobitamilan.net/download/software/',$file);
    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/zip.gif" alt=".zip" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/zip.gif" alt=".zip" /> <a href="http://mobitamilan.net/download/software/',$file);
    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/sis.gif" alt=".sis" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/sis.gif" alt=".sis" /> <a href="http://mobitamilan.net/download/software/',$file);
    echo 
    $file;
    ?>
    Last edited by metulj; 04.01.11, 22:04. Reason: use [ php ] tag [ / php ] for posting php code, specially for longer code

    #2
    I would get rid of this line:
    PHP Code:
    $file=str_replace('_script/''http://mobitamilan.net/download/software/_script/',$file); 
    and use something like:
    PHP Code:
    $file preg_replace("/_script\/(.*?)\/> <a href=\"/is","<img src=\"http://mobitamilan.net/download/software/$1/> <a href=\"http://mobitamilan.net/download/software/",$file); 
    as your causing yourself way to much hard coding here:
    PHP Code:
    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/file.gif" alt=".sisx" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/file.gif" alt=".sisx" /> <a href="http://mobitamilan.net/download/software/',$file);
    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/jar.png" alt=".jar" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/jar.png" alt=".jar" /> <a href="http://mobitamilan.net/download/software/',$file);
    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/zip.gif" alt=".zip" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/zip.gif" alt=".zip" /> <a href="http://mobitamilan.net/download/software/',$file);
    $file=str_replace('<img src="http://mobitamilan.net/download/software/_script/sis.gif" alt=".sis" /> <a href="''<img src="http://mobitamilan.net/download/software/_script/sis.gif" alt=".sis" /> <a href="http://mobitamilan.net/download/software/',$file);
    echo 
    $file
    (All These lines are not required either)
    Last edited by something else; 04.01.11, 20:53.

    Comment

    Working...
    X