[Solucionado]Script me produce un ISE 500

Iniciado por [u]nsigned, 11 Enero 2012, 19:52 PM

0 Miembros y 1 Visitante están viendo este tema.

[u]nsigned

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

Código (php) [Seleccionar]
<?php
$id 
$_GET['id'];
echo 
$id;
$GM_KEY '************************************************************************';
$link mysql_connect('localhost','******','******')or die('No se pudo conectar con MySQL');
mysql_select_db('*******'$link)or die('No se pudo abrir DD.BB');
$sql 'SELECT id, categoria, nombre, direccion, latitude, longitude FROM lugares WHERE lugares.id='.$id;
$result = @mysql_query($sql)or die('no se pudo ller ubicaciones desde DD.BB<br>'.mysql_error().'<br>'.__LINE__);

if(
mysql_num_rows($result))
{
   
$lugar mysql_fetch_object($result);
}
@
mysql_free_result($result);
@
mysql_close($link);
$URL "http://maps.google.com/maps/geo?q="urlencode($lugar->direccion) .",Rawson,Chubut,Argentina&output=json&language=es&oe=utf8&key="$GM_KEY;
//die($URL);
$json file_get_contents($URL);
$json json_decode($json);

if( 
$json->Status->code == 200 )
{
$coor $json->Placemark[0]->Point->coordinates;
unset($json);
}
else 
{
die("Status code: " $json->Status->code);
}
?>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Probando Gogle Maps</title>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<?=$GM_KEY?>" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="jquery.gmap-1.1.0-min.js" type="text/javascript"></script>
</head>
<body>
<div id="map" style="width:700px; height:500px; border:1px solid #777; overflow: hidden;"></div>
<script>
$("#map").gMap({
markers: [{
latitude: <?=$coor[1]?>,
longitude: <?=$coor[0]?>,
html:"<p><b><?=$lugar->nombre?></b></p><a href='./comollegar.php?lat=<?=$coor[1]?>&lon=<?=$coor[0]?>'>C&oacute;mo Llegar?</a>",
popup:true
}],
zoom:15
});
</script>
</body>
</html>


Resultado:

script?id=1

CitarInternal 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.

No hay atajo ante la duda, el misterio se hace aquí...
Se hace carne en cada uno, el misterio es existir!