visionplus
asked on
paging with php
Please help for php secure paging
"Paging" is usually done via the MySQL SELECT....LIMIT clause, but if you can describe you are trying to do we can help better - you've given us nine words including the title and two of those are PHP.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this is what I use for my paging, very simple, very easy.
<?php
$Q2="select count(*) as numrows from items where sub = '$_GET[ite]';";
$D4=mysql_fetch_array(mysql_query($Q2));
if($D4['numrows'] > $_SESSION['rowlimit']){
if($_SESSION[rowlimit]!=0){
?>
<div id="header">
<H4 class="footer">
<SPAN class="block">
</SPAN>
<center>
<SPAN style="text-align:right; float:right;" onclick="window.location='#top'">
<img src="include/database/48px-Go-down.svg2.png" title="View Top" width="16" />
</SPAN><?php
$ff=ceil($D4['numrows']/$_SESSION['rowlimit']);
?>
<select style="width:auto;font-size:14px" onChange="window.location=this.value;" name="drop_down">
<?php
for ($i=1; $i<=$ff; $i++){
$rowscount=$i * $_SESSION['rowlimit'];
$rowscounts=$rowscount - $_SESSION['rowlimit'];
$ffd= 'Row '.$rowscounts." to " .$rowscount.' - '.$i.'/'.$ff.' Pages'; ;
#echo "<option value=\"?category=".$_GET['category']."&row=$rowscounts\">$ffd</option>";
//$optionlayout.="<option value=\"?category=".$_GET['category']."&row=$rowscounts\">$ffd</option>\n";
if($_GET['row']==$rowscounts){
$nowrow=$ffd;
$optionlayout.="<option value=\"?category=".$_GET['category']."&row=$rowscounts\" selected>$ffd</option>\n";
}else{
$optionlayout.="<option value=\"?category=".$_GET['category']."&row=$rowscounts\">$ffd</option>\n";
}
}
echo $optionlayout;
?>
</select></center>
</H4>
</div>
<?php
}
}
?>
@Dhaest;
My solution is working. I directly copied and pasted from my own code which I am using. I just showed the way.
My solution is working. I directly copied and pasted from my own code which I am using. I just showed the way.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.