Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/03/2011, 17:44
mamonga
 
Fecha de Ingreso: abril-2010
Mensajes: 86
Antigüedad: 14 años
Puntos: 0
$HTTP_GET_VARS en drupal

Hola amigos, os comento mi problema.
Estoy intentando hacer un pequeño directorio que se organize según la letra pasada por url, he probado definiendo la letra y funciona perfectamente, el problema es que no consigo recibir la variable $letra usando $HTTP_GET_VARS["letra"];

¿Alguna idea? No se que falla.

El codigo es este:
--------------------------------------------------------------------------------
Código PHP:
<?php
$dbhost
="xxxxxxxxx";  // host del MySQL (generalmente localhost)
$dbusuario="xxxxxxxxxxxx"// aqui debes ingresar el nombre de usuario
$dbpassword="xxxxxxxxxx"// password de acceso para el usuario de la
$db="xxxxxxxxxxxxx";        // Seleccionamos la base con la cual trabajar
$conexion mysql_connect($dbhost$dbusuario$dbpassword);
mysql_select_db($db$conexion);


$letra=$HTTP_GET_VARS["letra"];
// poniendo la letra A a modo de ejemplo, todo funciona perfectamente
// $letra=A;



$sql "SELECT * FROM ongs WHERE titulo LIKE '"$letra ."%'";
$result mysql_query($sql) or die (mysql_error());

echo 
'<table border="0">';
echo 
"<tr>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=A\" >A</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=B\" >B</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=C\" >C</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=D\" >D</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=E\" >E</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=F\" >F</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=G\" >G</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=H\" >H</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=I\" >I</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=J\" >J</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=K\" >K</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=L\" >L</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=M\" >M</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=N\" >N</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=O\" >O</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=P\" >P</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=Q\" >Q</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=R\" >R</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=S\" >S</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=T\" >T</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=U\" >U</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=V\" >V</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=W\" >W</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=X\" >X</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=Y\" >Y</a></td>";
echo 
"<td><a href=\"http://www.xxxxxxxxx.com/ongs?letra=Z\" >Z</a></td>";
echo 
"</tr>";
echo 
'</table>';



echo 
'<table border="0">';

   while(
$row mysql_fetch_array($result)){
$imagen=''.$row["imagen"].'';
$url=''.$row["url"].'';
$titulo=''.$row["titulo"].'';
$votos=''.$row["votos"].'';
$descripcion=''.$row["descripcion"].'';
$id=''.$row["id"].'';

echo 
"<tr><td><a href=\"$url\" target=\"_blank\"><img src=\"../sites/default/files/logos/$imagen\" alt=\"$titulo\" ></a><br>Votos recibidos: $votos &nbsp&nbsp&nbsp  <a href=\"http://www.xxxxxxxxx.com/archivos/votacion.php?ong=$id\" target=\"_blank\"><img src=\"../archivos/imagenes/boton_votar.jpg\" alt=\"Votar\" ></a></td>";
echo 
"<td><a href=\"$url\" target=\"_blank\">$titulo</a><br>\"$descripcion\"</td></tr>";


}

echo 
'</table>';

echo 
$letra;
?>
---------------------------------------------------------------------------------

Gracias por la ayuda

¡Saludos!