Hello guys! can anyone pls help me to create a last 10 searches in mp3 search this my index.php
<? include'config.php'; $q = $_GET['q']; $q = str_replace('"', "'", $q); $q = str_replace(' ', "+", $q); $q = stripslashes($q); $val = $_GET['q']; $val = str_replace('_',' ',$val); $var = str_replace(' ','_',$val); if(isset($_GET['page'])){ $page = $_GET['page']; } if(!isset($_GET['page'])){ $page = 0; } if(isset($_GET['hal'])){ if($_GET['hal'] > 0) { $page = ($_GET['hal']-1)*10; } } $p = $page; if (!empty($val)){ $title = $val; }else{ $title = 'Mp3 Music Download'; }?> <? $file = file('http://search.4shared.com/network/searchXml.jsp?sortType=1&sortOrder=1&sortmode=3&q='.str_replace(' ','+',$q).'&searchmode=3&searchDescription=&searchExtention=mp3&sizeCriteria=atleast&sizevalue=10&start='.$page); $mybe = $q; $mungkin1 = 'http://www.google.com/m/search?hl=id&q='.str_replace('_','+',$mybe); $mungkin2 = file_get_contents($mungkin1); $mung = explode('/gwt/x?q',$mungkin2); $mungk= cut($mungkin2,'Mungkin maksud Anda adalah:','</a> '); $mungkin= cut($mungk,'&q=','&spell'); $file = @implode("",$file); $total = cut($file,'<total-files>','</total-files>'); $toth = ceil($total/10); $count = $total / 10; $now = ($page/10)+1; $h = ($hlm-1)*10; if(!empty($q) && empty($_GET['hal'])){ $gq = str_replace('+','_',$q); header("location:/$gq-p1.html"); } $strt =strstr($file,'<result-files>'); $exp = explode('<file>',$strt); ?> <?include"head.php";?> <!--content -->Search Artist or Song title :
<form method="get" action="/"> <input type="text" name="q" value="<?echo $val;?>"><input type="submit" value="Search" /></form> <? if (!empty($total)){ $val = str_replace('_',' ',$val); echo ''.$total.' results for '.str_replace('+',' ',$val).''; }else{ echo 'No results for '.str_replace('+',' ',$val).''; } if (empty($q)){ echo 'Last Updates'; } if (!empty($mungkin)){ echo 'Dead you mean <a href=/'.str_replace('+','_',$mungkin).'.html>'.str_replace('+',' ',$mungkin).'</a>?'; } ?> <? for($i = 1; $i <= 10; $i++){ $name = cut($exp[$i],'<name>','</name>'); $output = preg_replace("/\W/e","_",$name); $name = strtolower($name); $name = ucfirst($name); $vname = valid($name); $vname = str_replace('-mp3','.htm',$vname); $size = cut($exp[$i],'<size>','</size>'); $purl = cut($exp[$i],'<flash-preview-url>','</flash-preview-url>'); $url = cut($exp[$i],'<url>','</url>'); $id = explode('/',$url); if (!empty($name)){ if($now <= $toth) { echo '['.$name.'](/view/) ('.$size.') '; } } } if(!empty($total)){ $nextpage = $p + 10; $prevpage = $p - 10; $nexthal = $now + 1; $prevhal = $now -1; $nextpage = '/'.str_replace('+','_',$q).'-p'.$nextpage.'.html'; $prevpage = '/'.str_replace('+','_',$q).'-p'.$prevpage.'.html'; $nexthal = '/'.str_replace('+','_',$q).'-p'.$nexthal.'.html'; $prevhal = '/'.str_replace('+','_',$q).'-p'.$prevhal.'.html'; echo ''; echo " Page $now/$toth "; if ( $now > 1 ) { echo "<a href=\""; echo $prevhal; echo "\">"; echo '« Prev | '; echo "</a>"; }else{ echo ' « Prev | ';} if ( $i != 1 ) { if($now != $toth) { echo "<a href=\""; echo $nexthal; echo "\">"; echo 'Next »'; echo "</a>"; }else{ echo ' Next » '; } } echo ''; }?> <?include"foot.php";?>