Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/01/2012, 23:43
flabio5
 
Fecha de Ingreso: abril-2011
Mensajes: 15
Antigüedad: 13 años
Puntos: 0
Respuesta: Problema pagina directorio mostrar mensaje de error

aqui voy a poner el codigo php (el codigo lo genera el dreamweaver automaticamente):

Código PHP:
Ver original
  1. <?php require_once('Connections/cnx.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33.  
  34. mysql_select_db($database_cnx, $cnx);
  35. $query_rsCategorias = "SELECT * FROM categorias";
  36. $rsCategorias = mysql_query($query_rsCategorias, $cnx) or die(mysql_error());
  37. $row_rsCategorias = mysql_fetch_assoc($rsCategorias);
  38. $totalRows_rsCategorias = mysql_num_rows($rsCategorias);
  39.  
  40. $colname_rsLocal = "-1";
  41. if (isset($_GET['categoria'])) {
  42.   $colname_rsLocal = $_GET['categoria'];
  43. }
  44. mysql_select_db($database_cnx, $cnx);
  45. $query_rsLocal = sprintf("SELECT * FROM `local` WHERE categoria = %s", GetSQLValueString($colname_rsLocal, "text"));
  46. $rsLocal = mysql_query($query_rsLocal, $cnx) or die(mysql_error());
  47. $row_rsLocal = mysql_fetch_assoc($rsLocal);
  48. $totalRows_rsLocal = mysql_num_rows($rsLocal);
  49.  
  50. $MM_paramName = "";
  51.  
  52. // *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
  53. // create the list of parameters which should not be maintained
  54. $MM_removeList = "&index=";
  55. if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";
  56. $MM_keepURL="";
  57. $MM_keepForm="";
  58. $MM_keepBoth="";
  59. $MM_keepNone="";
  60. // add the URL parameters to the MM_keepURL string
  61. reset ($_GET);
  62. while (list ($key, $val) = each ($_GET)) {
  63.     $nextItem = "&".strtolower($key)."=";
  64.     if (!stristr($MM_removeList, $nextItem)) {
  65.         $MM_keepURL .= "&".$key."=".urlencode($val);
  66.     }
  67. }
  68. // add the Form parameters to the MM_keepURL string
  69. if(isset($_POST)){
  70.     reset ($_POST);
  71.     while (list ($key, $val) = each ($_POST)) {
  72.         $nextItem = "&".strtolower($key)."=";
  73.         if (!stristr($MM_removeList, $nextItem)) {
  74.             $MM_keepForm .= "&".$key."=".urlencode($val);
  75.         }
  76.     }
  77. }
  78. // create the Form + URL string and remove the intial '&' from each of the strings
  79. $MM_keepBoth = $MM_keepURL."&".$MM_keepForm;
  80. if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1);
  81. if (strlen($MM_keepURL) > 0)  $MM_keepURL = substr($MM_keepURL, 1);
  82. if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1);
  83. ?>