next page

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

5 replies · 396 views · started 17 years ago · 1 min read

3 participants
wapmetal Lead · 609 posts #1

i have created my own script gb but theres a problem in sending to next page wot i mean is if i click nextpage, it dont sends to 2nd page so it returns to the first page

<?php

header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php

$nick = $_GET["nick"];
$device = $_GET["device"];
$msg = $_GET["msg"];
$email = $_GET["email"];
include("core.php");
include("config.php");

echo "<card id=\"irc\" title=\"$stitle\">";
echo "<p align=\"center\">";
echo "<img src=\"gb.gif\" alt=\"\"/><br/>";

echo "<b>Please Report all Errors here!</b>";
echo "<br/>";
echo "</p>";
echo "<p>";
echo "<small>";
echo "<a href=\"write.php\">[Write Text]</a><br/>";
echo "---<br/>";

 if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM keanpogi"));

    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

        $sql = "SELECT id, nick, msg, email, device FROM keanpogi ORDER BY id DESC LIMIT $limit_start, $items_per_page";
    $cou = $limit_start;
	$items = mysql_query($sql);
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
    $cou++;
  /// echo "$cou.";

$msg2 = parsepm($msg);

echo "Nick: ".htmlspecialchars($item[1])."
<br/>"; 
echo "Email: ".htmlspecialchars($item[3])."
<br/>";
echo "Device: ".htmlspecialchars($item[4])."
<br/>";
echo "Message: ".htmlspecialchars($item[2])."
<br/>";

echo "<img src=\"line.gif\" alt=\"*\"/><br/>";

}

if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"index.php?action=results&page=$ppage\">«Prev</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"index.php?action=results&page=$npage\">Next»</a>";
    }
    echo "<br/>Page $page|$num_pages<br/>";
    
}
echo "</small>";
echo "</p>";
echo "<p align=\"center\">";
echo "<small>";
echo "Powered by: <a href=\"index.php\">VaMpirEfreakz</a><br/>";

echo "</small>";

echo "</p>";
echo "</card>";

?>
</wml>

how can i fixed it?LOL

wapmetal Lead · 609 posts #2

thers something wrong in this code i think

 if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM keanpogi"));

    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

        $sql = "SELECT id, nick, msg, email, device FROM keanpogi ORDER BY id DESC LIMIT $limit_start, $items_per_page";
    $cou = $limit_start;

and when i change $page=1 to $page=2

now it shows 2nd page

 if($page=="" || $page<=0)$page=[b]2[/b];
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM keanpogi"));

    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

        $sql = "SELECT id, nick, msg, email, device FROM keanpogi ORDER BY id DESC LIMIT $limit_start, $items_per_page";
    $cou = $limit_start;
subzero Super moderator Fellow · 3,954 posts #3
<?php

header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php

$nick = $_GET["nick"];
$device = $_GET["device"];
$msg = $_GET["msg"];
$email = $_GET["email"];
$page = $_GET["page"];
include("core.php");
include("config.php");

echo "<card id=\"irc\" title=\"$stitle\">";
echo "<p align=\"center\">";
echo "<img src=\"gb.gif\" alt=\"\"/><br/>";

echo "<b>Please Report all Errors here!</b>";
echo "<br/>";
echo "</p>";
echo "<p>";
echo "<small>";
echo "<a href=\"write.php\">[Write Text]</a><br/>";
echo "---<br/>";

 if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM keanpgi"));

    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

        $sql = "SELECT id, nick, msg, email, device FROM astig ORDER BY id DESC LIMIT $limit_start, $items_per_page";
    $cou = $limit_start;
	$items = mysql_query($sql);
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
    $cou++;
  /// echo "$cou.";

$msg2 = parsepm($msg);

echo "Nick: ".htmlspecialchars($item[1])."
<br/>"; 
echo "Email: ".htmlspecialchars($item[3])."
<br/>";
echo "Device: ".htmlspecialchars($item[4])."
<br/>";
echo "Message: ".htmlspecialchars($item[2])."
<br/>";

echo "<img src=\"line.gif\" alt=\"*\"/><br/>";

}

if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"index.php?action=results&page=$ppage\">«Prev</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"index.php?action=results&page=$npage\">Next»</a>";
    }
    echo "<br/>Page $page|$num_pages<br/>";
    
}
echo "</small>";
echo "</p>";
echo "<p align=\"center\">";
echo "<small>";
echo "Powered by: <a href=\"index.php\">VaMpirEfreakz</a><br/>";

echo "</small>";

echo "</p>";
echo "</card>";

?>
</wml>

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #5

lol yeah its does look like it lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

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