elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web (Moderador: #!drvy)
| | |-+  [Solucionado]Script me produce un ISE 500
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Solucionado]Script me produce un ISE 500  (Leído 1,573 veces)
[u]nsigned


Desconectado Desconectado

Mensajes: 2.397

JS/Node developer


Ver Perfil WWW
[Solucionado]Script me produce un ISE 500
« en: 11 Enero 2012, 19:52 pm »

No logro descubrir por que el siguiente script me produce un Error Interno de Servidor 500 (error inesperado):

Código
  1. <?php
  2. $id = $_GET['id'];
  3. echo $id;
  4. $GM_KEY = '************************************************************************';
  5. $link = mysql_connect('localhost','******','******')or die('No se pudo conectar con MySQL');
  6. mysql_select_db('*******', $link)or die('No se pudo abrir DD.BB');
  7. $sql = 'SELECT id, categoria, nombre, direccion, latitude, longitude FROM lugares WHERE lugares.id='.$id;
  8. $result = @mysql_query($sql)or die('no se pudo ller ubicaciones desde DD.BB<br>'.mysql_error().'<br>'.__LINE__);
  9.  
  10. if(mysql_num_rows($result))
  11. {
  12.   $lugar = mysql_fetch_object($result);
  13. }
  14. @mysql_close($link);
  15. $URL = "http://maps.google.com/maps/geo?q=". urlencode($lugar->direccion) .",Rawson,Chubut,Argentina&output=json&language=es&oe=utf8&key=". $GM_KEY;
  16. //die($URL);
  17. $json = file_get_contents($URL);
  18. $json = json_decode($json);
  19.  
  20. if( $json->Status->code == 200 )
  21. {
  22. $coor = $json->Placemark[0]->Point->coordinates;
  23. unset($json);
  24. }
  25. else
  26. {
  27. die("Status code: " . $json->Status->code);
  28. }
  29. ?>
  30. <!DOCTYPE html>
  31. <html>
  32. <head>
  33. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  34. <title>Probando Gogle Maps</title>
  35. <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<?=$GM_KEY?>" type="text/javascript"></script>
  36. <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.2.min.js" type="text/javascript"></script>
  37. <script src="jquery.gmap-1.1.0-min.js" type="text/javascript"></script>
  38. </head>
  39. <body>
  40. <div id="map" style="width:700px; height:500px; border:1px solid #777; overflow: hidden;"></div>
  41. <script>
  42. $("#map").gMap({
  43. markers: [{
  44. latitude: <?=$coor[1]?>,
  45. longitude: <?=$coor[0]?>,
  46. html:"<p><b><?=$lugar->nombre?></b></p><a href='./comollegar.php?lat=<?=$coor[1]?>&lon=<?=$coor[0]?>'>C&oacute;mo Llegar?</a>",
  47. popup:true
  48. }],
  49. zoom:15
  50. });
  51. </script>
  52. </body>
  53. </html>

Resultado:

script?id=1

Citar
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@******* and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Alguna idea?

Saludos

PD: Los  asterisco son intencionales

Solucion
Tenia un conflicto con la redireccion, y no me toma el script sino indicaba la extensión '.php' en la url.


« Última modificación: 11 Enero 2012, 22:03 pm por El As del Club Paris » En línea

No hay atajo ante la duda, el misterio se hace aquí...
Se hace carne en cada uno, el misterio es existir!
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
comparacion de cadenas en shell script[Solucionado]
Scripting
dark_fidodido 2 14,165 Último mensaje 28 Agosto 2009, 17:54 pm
por dark_fidodido
[python] ayuda con script ¨^^(SOLUCIONADO)
Scripting
EvilGoblin 3 3,531 Último mensaje 17 Abril 2010, 03:02 am
por Novlucker
[Shell script] no me funciona un comando (SOLUCIONADO)
Scripting
moikano→@ 2 3,578 Último mensaje 26 Octubre 2010, 19:22 pm
por moikano→@
[SOLUCIONADO] Ayuda en script C++
Programación C/C++
Stakewinner00 3 2,430 Último mensaje 4 Agosto 2012, 22:44 pm
por Stakewinner00
¿Qué produce y cómo se produce la electromigración?
Noticias
El_Andaluz 0 1,555 Último mensaje 7 Junio 2020, 16:58 pm
por El_Andaluz
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines