[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Paging problems

Asked by saul_roldan in PHP Scripting Language, Adobe Dreamweaver

Tags: php, dreamweaber

I create a page with paging as follow:

First| Previous |Next | Last

everything is working fine with the only problem that it keep going back. Lets say for example that Im in pages 5 6 7 8, and I click on page 7 to see the content when I come back to select page 8 it send me to pages 1 2 3 4. How can I prevent this to happen?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
<?php require_once('../../../Connections/newWeb.php'); ?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
 
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 
 
  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}
 
$MM_restrictGoTo = "../../Usuario/login_Admin.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) 
  $MM_referrer .= "?" . $QUERY_STRING;
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$currentPage = $_SERVER["PHP_SELF"];
 
$maxRows_BiblioCapitulos = 15;
$pageNum_BiblioCapitulos = 0;
if (isset($_GET['pageNum_BiblioCapitulos'])) {
  $pageNum_BiblioCapitulos = $_GET['pageNum_BiblioCapitulos'];
}
$startRow_BiblioCapitulos = $pageNum_BiblioCapitulos * $maxRows_BiblioCapitulos;
 
mysql_select_db($database_newWeb, $newWeb);
$query_BiblioCapitulos = "SELECT * FROM BiblioCapitulos ORDER BY capitulo_id ASC";
$query_limit_BiblioCapitulos = sprintf("%s LIMIT %d, %d", $query_BiblioCapitulos, $startRow_BiblioCapitulos, $maxRows_BiblioCapitulos);
$BiblioCapitulos = mysql_query($query_limit_BiblioCapitulos, $newWeb) or die(mysql_error());
$row_BiblioCapitulos = mysql_fetch_assoc($BiblioCapitulos);
 
if (isset($_GET['totalRows_BiblioCapitulos'])) {
  $totalRows_BiblioCapitulos = $_GET['totalRows_BiblioCapitulos'];
} else {
  $all_BiblioCapitulos = mysql_query($query_BiblioCapitulos);
  $totalRows_BiblioCapitulos = mysql_num_rows($all_BiblioCapitulos);
}
$totalPages_BiblioCapitulos = ceil($totalRows_BiblioCapitulos/$maxRows_BiblioCapitulos)-1;
 
$queryString_BiblioCapitulos = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_BiblioCapitulos") == false && 
        stristr($param, "totalRows_BiblioCapitulos") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_BiblioCapitulos = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_BiblioCapitulos = sprintf("&totalRows_BiblioCapitulos=%d%s", $totalRows_BiblioCapitulos, $queryString_BiblioCapitulos);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Admin_layout.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Justicia de Dios</title>
<!-- InstanceEndEditable -->
<script src="../../SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
 
<link href="../../admin css/adminGlobal.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="../../SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css">
 
<style type="text/css">
<!--
body {
	background-image: url(../../../images/backg1.png);
	background-repeat: repeat-x;
	background-color: #04181A;
}
-->
</style>
 
</head>
 
<body>
 
<div id="Envoltura">
   
    <div id="envolturaImagen">
        <div id="envolturaArticulos">
        <div id="AdminColumnaIZQ">
            <h1>Administraci&oacute;n: <!-- InstanceBeginEditable name="nombre seccion" -->Biblioteca<!-- InstanceEndEditable --></h1>
          
            <p>&nbsp;</p>
            <!-- InstanceBeginEditable name="artiContenido" -->
            <p>Area LISTA CAPITULOS DE LIBROS de la biblioteca</p>
            <p><a href="anadir_admin.php">A&ntilde;adir capitulo</a></p>
            <table border="0" align="center" cellpadding="0" cellspacing="0" id="AdminTable">
                <tr>
                    <td colspan="3" align="center" id="TableHeading2"><a href="<?php printf("%s?pageNum_BiblioCapitulos=%d%s", $currentPage, 0, $queryString_BiblioCapitulos); ?>">First</a>| <a href="<?php printf("%s?pageNum_BiblioCapitulos=%d%s", $currentPage, max(0, $pageNum_BiblioCapitulos - 1), $queryString_BiblioCapitulos); ?>">Previous</a> |<a href="<?php printf("%s?pageNum_BiblioCapitulos=%d%s", $currentPage, min($totalPages_BiblioCapitulos, $pageNum_BiblioCapitulos + 1), $queryString_BiblioCapitulos); ?>">Next</a> | <a href="<?php printf("%s?pageNum_BiblioCapitulos=%d%s", $currentPage, $totalPages_BiblioCapitulos, $queryString_BiblioCapitulos); ?>">Last</a></td>
                </tr>
                <tr>
                    <td colspan="3" id="TableHeading">Lista capitulos de libros</td>
                    </tr>
                <tr>
                    <td><p class="center">Nombre Libro</p></td>
                    <td><p class="center">Nombre Capitulo</p></td>
                    <td><p class="center">Online</p></td>
                </tr>
                <?php do { ?>
                    <tr>
                        <td><p><?php echo $row_BiblioCapitulos['NombreLibro']; ?></p></td>
                        <td><p><a href="editar_admin.php?capitulo_id=<?php echo $row_BiblioCapitulos['capitulo_id']; ?>"><?php echo $row_BiblioCapitulos['nombre_capitulo']; ?></a></p></td>
                        <td><p class="center"><?php echo $row_BiblioCapitulos['Online']; ?></p></td>
                    </tr>
                    <?php } while ($row_BiblioCapitulos = mysql_fetch_assoc($BiblioCapitulos)); ?>
            </table>
            <p>&nbsp;</p>
            <!-- InstanceEndEditable -->
            <p>&nbsp;</p>
</div>
        <div id="AdminColumnaDER">
        
        
        <div id="CollapsiblePanel1" class="CollapsiblePanel">
    <div class="CollapsiblePanelTab">Inicio</div>
            <div class="CollapsiblePanelContent" style="display: none">
                <p class="NavegacionAdmin">&raquo;<a href="../../inicio/Articulos/listado_admin.php">Articulos</a></p>
                <p class="NavegacionAdmin">&raquo;<a href="../../inicio/libros/listado_admin.php">Libros</a></p>
            </div>
        </div>
           
        
        <div id="CollapsiblePanel2" class="CollapsiblePanel">
            <div class="CollapsiblePanelTab">Sala Investigacion</div>
            <div class="CollapsiblePanelContent" style="display: none">
                <p class="NavegacionAdmin">&raquo;Menu            </p>
            </div>
        </div>
        <div id="CollapsiblePanel3" class="CollapsiblePanel">
            <div class="CollapsiblePanelTab">Estudios Biblicos</div>
            <div class="CollapsiblePanelContent" style="display: none">
                <p class="NavegacionAdmin">&raquo;<a href="../../Estudios Biblicos/articulos/listado_admin.php">Articulos</a></p>
                <p class="NavegacionAdmin">&raquo;<a href="../../Estudios Biblicos/ArticuloMenu/listado_admin.php">Menu</a></p>
                <p class="NavegacionAdmin">&raquo;<a href="../../Estudios Biblicos/ArticuloSubMenu/listado_admin.php">Submenu</a></p>
            </div>
        </div>
        <div id="CollapsiblePanel4" class="CollapsiblePanel">
            <div class="CollapsiblePanelTab">Biblioteca</div>
            <div class="CollapsiblePanelContent" style="display: none">
                <p class="NavegacionAdmin">&raquo;<a href="../Secciones/listado_admin.php">Secciones</a></p>
                <p class="NavegacionAdmin">&raquo;<a href="../MenuLibros/listado_admin.php">Menu</a></p>
                <p class="NavegacionAdmin">&raquo;<a href="listado_admin.php">Capitulos</a></p>
            </div>
        </div>
        <div id="CollapsiblePanel5" class="CollapsiblePanel">
            <div class="CollapsiblePanelTab">Sermones</div>
            <div class="CollapsiblePanelContent" style="display: none">
                <p><a href="../../Sermones/listado_admin.php" class="NavegacionAdmin">&raquo;Sermones</a></p>
            </div>
        </div>
        <div id="CollapsiblePanel6" class="CollapsiblePanel">
            <div class="CollapsiblePanelTab">Usuario</div>
            <div class="CollapsiblePanelContent" style="display: none">
                <p><a href="../../Usuario/login_Admin.php" class="NavegacionAdmin">&raquo;Usuario </a></p>
            </div>
        </div>
        
        
        
        
         </div></div>
    </div>
    
    
      <div id="auspicia"><?php include('../../../includes/PiedePagina.php'); ?> </div>
 
    
</div>
<script type="text/javascript">
<!--
var CollapsiblePanel2 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel2", {contentIsOpen:false});
var CollapsiblePanel3 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel3", {contentIsOpen:false});
var CollapsiblePanel4 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel4", {contentIsOpen:false});
var CollapsiblePanel5 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel5", {contentIsOpen:false});
var CollapsiblePanel6 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel6", {contentIsOpen:false});
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:false});
//-->
</script>
 
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($BiblioCapitulos);
?>
[+][-]12/22/08 09:51 AM, ID: 23228081Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/22/08 10:34 AM, ID: 23228412Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/22/08 10:50 AM, ID: 23228554Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/22/08 11:08 AM, ID: 23228686Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/16/09 05:59 AM, ID: 23392754Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01/16/09 07:17 AM, ID: 23393645Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: PHP Scripting Language, Adobe Dreamweaver
Tags: php, dreamweaber
Sign Up Now!
Solution Provided By: Michael701
Participating Experts: 1
Solution Grade: A
 
[+][-]01/16/09 09:11 AM, ID: 23395002Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02/23/09 04:07 AM, ID: 23710242Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02/28/09 07:30 PM, ID: 23766641Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625