Next Page Link

Started on the old forum in March 2009 · view the original in the archive · old links redirect here

#wapbuddy

4 replies · 525 views · started 17 years ago · 1 min read

3 participants
modfiles Developer · 200 posts #1

Im started to get piss off by this wapbuddy directory list that im using. Just recently, the next page page link doesnt want to work anymore. No matter how many times i click it, its still in page 1. I dont what the problem is cause it was workin fine in my local server. But when i upload it and test it to my webhost, doesnt work. The Jump to Page option doesnt work also. I encounter this same problem but i was able to solve it by putting this snippet register_globals = On in my php.ini file (I know its a security threat turning it on) but now, doesnt work. I have emailed my webhost already and waiting for their response but i want some insights also from pro coders. Anyway heres my snippet of wapbuddy.

<?php
include '../../../core.php';
//header('Content-Type: application/xhtml+xml');
$conf['items_per_page'] = 8;
echo "<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//WAPFORUM//DTD XHTML Mobile 1.0//EN' 'http://www.wapforum.org/DTD/xhtml-mobile10.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'><head>
<title>";
echo $site;
echo "</title>
<meta http-equiv='cache-Control' content='no-cache'/>
<link rel='shortcut icon' href='/images/favicon.ico' type='image/x-icon'/>
<style type=\"text/css\">";
include ('../../../css.php');
if(isset($npage))$page=$npage-1;
$total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array(); 
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file!="php.ini")
{
$file_array[] =  $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
echo "</style></head><body>
<div><a accesskey='top' id='top'></a></div>
<div class=\"adt\">";
buzz();
echo '<br/>';
random();
echo "</div>
<div class=\"center\">Racing Games "
.'('.($page+1).'/'.ceil($file_count/$conf["items_per_page"]).')</div>'
."<div class=\"left\">";
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];  
while (list($fileIndexValue, $file_name) = each ($file_array))
{   
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
echo strip_ext($file_name)."<br />
<a href=\"$file_name\">Download (". round(filesize($file_name)/1024,1) . "kb)</a><br /><br />";
$total = $total + filesize($file_name);
}
}
{
echo '</div>'
.'<div class="center"><br />';
admob();
echo '<br />';
}
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\"><<Prev</a> ";
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next>></a>";
}
echo "<br />$file_count ";
if ($file_count == 1)
{echo "File";}
else
{echo "Files";}
if (($file_count > 0) AND ($last_record < $file_count))
{
echo '<br /><form action="'.$_SERVER["PHP_SELF"].'" method="get">
Jump to Page: <input class="box" name="npage" title="Jump to Page:" size="3" value="" maxlength="3"/>
<input type="submit" value="Go"/></form>';
}
echo '</div>
<div class="adb">';
buzz2();
echo "</div>
<div class='footl'>";
include'../../../foot.php';
echo "<a href=\"../index.php\"><img alt=\"<\" src=\"../../../images/back.png\"/>Games</a>";
echo "</div>
</body>";
}
closedir($dp);
echo "</html>";
exit();
?>
GumSlone Administrator Principal · 1,690 posts #2

try to add this lines on the top of your script

if(isset($_GET)){foreach($_GET as $key=>$value){$key=$value;}}
if(isset($_POST)){foreach($_POST as $key=>$value){$key=$value;}}

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

modfiles Developer · 200 posts #3

Thanks for the reply boss. But still, the problem wasn't solve 🙁 Im trying to configure my cPanel now and see if their is somethin that can help me solve this problem.

Guest #4

replace

if(isset($npage))$page=$npage-1;

with

$page=$_REQUEST['page'];

Anshul Senior · 296 posts #5

add it on the top of your page

foreach($_POST AS $key => $value) {
          ${$key} = $value; 
          } 

        foreach($_GET AS $key => $value) {
          ${$key} = $value; 
          }  

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