Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP
i want to remove totalRows from link browser ,i dont want to sombody can see how meny rows i have,imm working with dreamweaver and the code was auto generated by recordset.please sombody can help me with this?Tnks and here is my code...
 

 
<?php require_once('Connections/filmconnexion.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_DataCategoria = 12;
$pagina = 0;
if (isset($_GET['pagina'])) {
  $pagina = $_GET['pagina'];
}
$startRow_DataCategoria = $pagina * $maxRows_DataCategoria;
 
$varCategoria_DataCategoria = "0";
if (isset($_GET["cat"])) {
  $varCategoria_DataCategoria = $_GET["cat"];
}
mysql_select_db($database_filmconnexion, $filmconnexion);
$query_DataCategoria = sprintf("SELECT * FROM tbl_film WHERE tbl_film.intCategoria = %s ", GetSQLValueString($varCategoria_DataCategoria, "int"));
$query_limit_DataCategoria = sprintf("%s LIMIT %d, %d", $query_DataCategoria, $startRow_DataCategoria, $maxRows_DataCategoria);
$DataCategoria = mysql_query($query_limit_DataCategoria, $filmconnexion) or die(mysql_error());
$row_DataCategoria = mysql_fetch_assoc($DataCategoria);
 
if (isset($_GET['totalRows_DataCategoria'])) {
  $totalRows_DataCategoria = $_GET['totalRows_DataCategoria'];
} else {
  $all_DataCategoria = mysql_query($query_DataCategoria);
  $totalRows_DataCategoria = mysql_num_rows($all_DataCategoria);
}
$totalPages_DataCategoria = ceil($totalRows_DataCategoria/$maxRows_DataCategoria)-1;
 
$queryString_DataCategoria = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pagina") == false && 
        stristr($param, "totalRows_DataCategoria") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_DataCategoria = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_DataCategoria = sprintf("&totalRows_DataCategoria=%d%s", $totalRows_DataCategoria, $queryString_DataCategoria);
    ?>
 

 

<div class="rezultfilm">
          <?php if ($totalRows_DataCategoria ?> 0) { // Show if recordset not empty ?>
  <?php do { ??>
    <div class="Filminitaliano"><a href="filminstreamingitalia.php?recordID=<?php echo $row_DataCategoria['id']; ?>"><img src="Imag/Cop/<?php echo $row_DataCategoria['imagine']; ??>" width="160" height="190" alt="filminitaliano.com|Film gratis in italiano|Italia Streaming Online Gratis"></a>
      <p><?php echo $row_DataCategoria['nome']; ??></p></div>
      <?php } while ($row_DataCategoria = mysql_fetch_assoc($DataCategoria)); ??>
 
            <?php } // Show if recordset not empty ??>
            <?php if ($totalRows_DataCategoria == 0) { // Show if recordset empty ??>
              Per questo momento non essiste nessun film in questa categoria!
  <?php } // Show if recordset empty ??>
  </div>
  ....................................
  <div>
    <table border="0">
      <tr>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(">">Prima pagina</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(" -="">">Preccedente</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Prossima</a>
            <?php } // Show if not last page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Ultima</a>
            <?php } // Show if not last page ??></td>
      </tr>
    </table>
  </div><div class="rezultfilm">
          <?php if ($totalRows_DataCategoria ?> 0) { // Show if recordset not empty ?>
  <?php do { ??>
    <div class="Filminitaliano"><a href="filminstreamingitalia.php?recordID=<?php echo $row_DataCategoria['id']; ?>"><img src="Imag/Cop/<?php echo $row_DataCategoria['imagine']; ??>" width="160" height="190" alt="filminitaliano.com|Film gratis in italiano|Italia Streaming Online Gratis"></a>
      <p><?php echo $row_DataCategoria['nome']; ??></p></div>
      <?php } while ($row_DataCategoria = mysql_fetch_assoc($DataCategoria)); ??>
 
            <?php } // Show if recordset not empty ??>
            <?php if ($totalRows_DataCategoria == 0) { // Show if recordset empty ??>
              Per questo momento non essiste nessun film in questa categoria!
  <?php } // Show if recordset empty ??>
  </div>
  ....................................
  <div>
    <table border="0">
      <tr>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(">">Prima pagina</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(" -="">">Preccedente</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Prossima</a>
            <?php } // Show if not last page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Ultima</a>
            <?php } // Show if not last page ??></td>
      </tr>
    </table>
  </div>
 

mysql_free_result($DataCategoria);
?>
Posted 15-Jan-13 2:51am
alex771314
Edited 15-Jan-13 2:58am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 668
1 OriginalGriff 396
2 Tadit Dash 345
3 sanket saxena 329
4 Peter Leow 193
0 Sergey Alexandrovich Kryukov 12,109
1 OriginalGriff 7,326
2 Peter Leow 5,003
3 Abhinav S 4,003
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web04 | 2.8.140421.2 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid