Código PHP:
Ver original
<?php require('seguridad.php'); conectar_base_datos(); echo "Bienvenido: <b>$row[7]</b>"; echo "<html><head><title>Mapa 2</title><script type='text/javascript' src='js_ajax.js'></script><link href='estilos_mapa.css' rel='stylesheet' type='text/css'></head><body>"; echo "<center><h1>Mapa del Mundo</h1></center>"; if ($_GET['x'] < 1 || $_GET['x'] > 100 || $_GET['y'] < 1 || $_GET['y'] > 100) { echo "<center><h3>Mapa Fuera de Rango</h3><p>S贸lo valores entre 1 y 100 para X e Y.</p></center>"; } else { $y = $_GET['y'] - 2; echo "<table align='center' class='mapa2'>"; for ($a = 0; $a < 5; $a++) { $x = $_GET['x'] - 2; echo "<tr>"; for ($b = 0; $b < 5; $b++) { echo "<td >"; if ($x > 100 or $y > 100 or $x < 1 or $y < 1) { echo ""; } else { echo "<div onmouseover=\"iniciarConsulta('mapa2_con.php?x=$x&y=$y');\" onmousemove=\"cursor('resultado');\" onmouseout=\"esconder('resultado');\" style='width: 50px; height:50px;'><a href='mapa2.php?x=$array[2]&y=$array[3]'>$array[2]/$array[3]</a></div>"; } echo "</td>"; $x++; } echo "</tr>"; $y++; } } $x_ = $_GET['x']; $x_1 = $_GET['x'] - 1; $x1 = $_GET['x'] + 1; $y_ = $_GET['y']; $y_1 = $_GET['y'] - 1; $y1 = $_GET['y'] + 1; echo "</table>"; echo "<table align='center'><tr><td colspan='3'>"; if ($_GET['y'] <= 1) { echo ""; } else { echo "<center><a href='mapa2.php?x=$x_&y=$y_1'><img src='img/flecha_up.png'></a></center>"; } echo "</td></tr><tr><td>"; if ($_GET['x'] <= 1) { echo ""; } else { echo "<a href='mapa2.php?x=$x_1&y=$y_'><img src='img/flecha_left.png'></a>"; } echo "</td><td><form action='mapa2.php' method='GET'>X : <input type='text' name='x' size='1' maxlength='3'> Y: <input type='text' name='y' size='1' maxlength='3'><input type='submit' value='IR'></form>"; echo "<td>"; if ($_GET['x'] >= 100) { echo ""; } else { echo "<a href='mapa2.php?x=$x1&y=$y_'><img src='img/flecha_right.png'></a>"; } echo "</td></tr><tr><td colspan='3'>"; if ($_GET['y'] == 100) { echo ""; } else { echo "<center><a href='mapa2.php?x=$x_&y=$y1'><img src='img/flecha_down.png'></a></center>"; } echo "</td></tr></table><div class='anuncio' id='resultado'></div><center><a href='main.php'>Volver</a></center></body></html>"; } ?>