beensent.php from the SP script, it only allows me to read the last 2 sent messages, how do i need to edit this to read all sent messages without the error i usually come up with lol. any help appreciated thanks
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Cache-Control: no-cache, must-revalidate");
include("config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml>";
echo "<card id=\"card1\" title=\"Outbox\">";
echo "<p align=\"center\">";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and password='$password'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
include("check.inc.php");
}
if ($ok>0)
{
include("online.inc.php");
$result2 = mysql_query("SELECT * FROM privatemessage WHERE from_username = '$username' order by date_sent desc");
$number_of_rows = mysql_num_rows($result);
$to_username=(mysql_result($result2,$page,"to_user name"));
$date_sent=(mysql_result($result2,$page,"date_sent "));
$pm_message=(mysql_result($result2,$page,"pm_messa ge"));
$has_it_been_read=(mysql_result($result2,$page,"ha s_it_been_read"));
echo "To: $to_username";
echo"
$date_sent
";
echo "<img src=\"bar.gif\" alt=\"----\"/>";
echo "
$pm_message
";
echo "<img src=\"bar.gif\" alt=\"----\"/>
";
echo "Recieved? $has_it_been_read
";
$page3=$page;
$number_of_rows=$number_of_rows+1;
if ($number_of_rows>$page)
{
$page2=$page+2;
$page=$page+1;
echo "
<a title=\"Enter\" href=\"beensent.php?username=$username&passwor d=$password&page=$page\">Page $page2</a>";
}
$zero=0;
if ($page3>0)
{
$page2=$page3;
$page=$page3-1;
echo "
<a title=\"Enter\" href=\"beensent.php?username=$username&passwor d=$password&page=$page\">Page $page2</a>";
}
echo "
<a title=\"Enter\" href=\"pm.php?username=$username&password=$pas sword\">Menu</a>";
}
echo "</p>";
echo "</card>";
echo "</wml>";
?>
</div>
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Cache-Control: no-cache, must-revalidate");
include("config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml>";
echo "<card id=\"card1\" title=\"Outbox\">";
echo "<p align=\"center\">";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and password='$password'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
include("check.inc.php");
}
if ($ok>0)
{
include("online.inc.php");
$result2 = mysql_query("SELECT * FROM privatemessage WHERE from_username = '$username' order by date_sent desc");
$number_of_rows = mysql_num_rows($result);
$to_username=(mysql_result($result2,$page,"to_user name"));
$date_sent=(mysql_result($result2,$page,"date_sent "));
$pm_message=(mysql_result($result2,$page,"pm_messa ge"));
$has_it_been_read=(mysql_result($result2,$page,"ha s_it_been_read"));
echo "To: $to_username";
echo"
$date_sent
";
echo "<img src=\"bar.gif\" alt=\"----\"/>";
echo "
$pm_message
";
echo "<img src=\"bar.gif\" alt=\"----\"/>
";
echo "Recieved? $has_it_been_read
";
$page3=$page;
$number_of_rows=$number_of_rows+1;
if ($number_of_rows>$page)
{
$page2=$page+2;
$page=$page+1;
echo "
<a title=\"Enter\" href=\"beensent.php?username=$username&passwor d=$password&page=$page\">Page $page2</a>";
}
$zero=0;
if ($page3>0)
{
$page2=$page3;
$page=$page3-1;
echo "
<a title=\"Enter\" href=\"beensent.php?username=$username&passwor d=$password&page=$page\">Page $page2</a>";
}
echo "
<a title=\"Enter\" href=\"pm.php?username=$username&password=$pas sword\">Menu</a>";
}
echo "</p>";
echo "</card>";
echo "</wml>";
?>
</div>
Comment