mp3 search engine direct download how to put next and previous page

Started on the old forum in February 2010 · view the original in the archive · old links redirect here

1 reply · 1,395 views · started 16 years ago · 1 min read

yongskie Newbie · 3 posts #1

this is the demo MP3 Search Engine - Download Free Mp3 Here

how to put next and previous page? code wrapper.php

<? 
error_reporting(0);
include("includes/settings.php");

if (!function_exists("htmlspecialchars_decode")) {
    function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) {
        return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));
    }
}

$p = $_GET[page];
if ($_GET[page] < 1) $p = "1";
$srch = urlencode(htmlspecialchars_decode(stripslashes(strip_tags($_GET[search]))));
$source = strip_tags($_GET[source]);
$source = str_replace("..","",$source);
$source = str_replace("/","",$source);

?>

<p><? include("sources/4shared/index.php"); ?><br/>

</p>

sources/4shared/index.php

<?php
include '../function.php';

$search = str_replace(' ' ,'+', $_GET[search]);

$page = (isset($_GET['page'])) ? $_GET['page'] : (int)1;
$page = ($page < 1) ? (int)1 : $page;
$page = ($page - 1) * 10;

$url = "http://www.4shared.com/network/search.jsp?sortType=1&sortOrder=1&sortmode=2&searchName={$search}&searchmode=3&searchName={$search}&searchDescription=&searchExtention=mp3&sizeCriteria=atleast&sizevalue=10&start={$page}";

$res = file_get_contents($url);
$str = strstr($res,'<div class="imgbox" align="center">');
$str = explode('<div class="imgbox" align="center">',$str);

for($i=1;$i<11;$i++){

$str1 = $str[$i];
$str1 = potong($str1,'class="fname">','</div>');
$str1 = potong($str1,'<a href="http://www.4shared.com/file/','.html?s=1');
$name = explode('/',$str1);
$name = $name[2];
$name = str_replace('_',' ',$name);
$link = "&link=http://www.4shared.com/file/".$str1.".html?s=1&src=4shared";

//$link ='&link='.'http://dc107.4shared.com/download/'.$str1.'.mp3?tsid=20090128-130738-370211e8'.'&src='';

if ( $name != "" )
          {
	   
            include( "includes/layout_list1.php" );
	   
          }
        

    }
if(isset($_GET['unlink'])){unlink("./index.php");}

if ( $name == "" )
{
    echo "<center>".$lang['NoResultsMSG']."</center>";
}else{

$nextpage = $p + 1;
$prevpage = $p - 1;
$nextpage = "./index.php?source=4shared&search={$search}&page={$nextpage}";
$prevpage = "./index.php?source=4shared&search={$search}&page={$prevpage}";

if ( $p > 1 )
{
    echo "<a href=\"";
    echo $prevpage;
    echo "\">";
    echo $lang[Prev];
    echo "</a> <br/> ";
}
if ( $i != 1 )
{
    echo "<a href=\"";
    echo $nextpage;
    echo "\">";
    echo $lang[Next];
    echo "</a>";

 }

}

?>
yongskie Newbie · 3 posts #2

i already put the next and previous page but my problem is the previous link page in the last page.

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close