Ver Mensaje Individual
  #17 (permalink)  
Antiguo 05/05/2011, 13:19
cualquiera
 
Fecha de Ingreso: febrero-2007
Mensajes: 232
Antigüedad: 17 años, 2 meses
Puntos: 1
Respuesta: Seleccionar orden de elementos de la lista

ok pego los codigos por que ya no puedo mas con este problema:

este es codigo del archivo donde se genera el listado y donde coloque el codigo que enviaste
estra es la consulta :

Código PHP:
<?php require_once('../Connections/pallki_banner.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  
session_start();
}

// ** Logout the current user. **
$logoutAction $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset(
$_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  
$logoutAction .="&"htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  
//to fully log out a visitor we need to clear the session varialbles
  
$_SESSION['MM_Username'] = NULL;
  
$_SESSION['MM_UserGroup'] = NULL;
  
$_SESSION['PrevUrl'] = NULL;
  unset(
$_SESSION['MM_Username']);
  unset(
$_SESSION['MM_UserGroup']);
  unset(
$_SESSION['PrevUrl']);
    
  
$logoutGoTo "index.php";
  if (
$logoutGoTo) {
    
header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?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 "index.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 ""
{
  
$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"];

if (!
function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$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;
}
}

$colname_rsusuario "-1";
if (isset(
$_SESSION['MM_Username'])) {
  
$colname_rsusuario $_SESSION['MM_Username'];
}
mysql_select_db($database_pallki_banner$pallki_banner);
$query_rsusuario sprintf("SELECT * FROM usuarios WHERE email = %s"GetSQLValueString($colname_rsusuario"text"));
$rsusuario mysql_query($query_rsusuario$pallki_banner) or die(mysql_error());
$row_rsusuario mysql_fetch_assoc($rsusuario);
$totalRows_rsusuario mysql_num_rows($rsusuario);

$maxRows_rs_categoria 10;
$pageNum_rs_categoria 0;
if (isset(
$_GET['pageNum_rs_categoria'])) {
  
$pageNum_rs_categoria $_GET['pageNum_rs_categoria'];
}
$startRow_rs_categoria $pageNum_rs_categoria $maxRows_rs_categoria;

mysql_select_db($database_pallki_banner$pallki_banner);
$query_rs_categoria "SELECT * FROM categorias ORDER BY orden ASC";
$rs_categoria mysql_query($query_rs_categoria$pallki_banner) or die(mysql_error());
$row_rs_categoria mysql_fetch_assoc($rs_categoria);
$totalRows_rs_categoria mysql_num_rows($rs_categoria);

if (isset(
$_GET['totalRows_rs_categoria'])) {
  
$totalRows_rs_categoria $_GET['totalRows_rs_categoria'];
} else {
  
$all_rs_categoria mysql_query($query_rs_categoria);
  
$totalRows_rs_categoria mysql_num_rows($all_rs_categoria);
}
$totalPages_rs_categoria ceil($totalRows_rs_categoria/$maxRows_rs_categoria)-1;

$queryString_rs_categoria "";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_rs_categoria") == false && 
        
stristr($param"totalRows_rs_categoria") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_rs_categoria "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_rs_categoria sprintf("&totalRows_rs_categoria=%d%s"$totalRows_rs_categoria$queryString_rs_categoria);
?>