Ver Mensaje Individual
  #9 (permalink)  
Antiguo 25/12/2011, 23:46
privatefta
(Desactivado)
 
Fecha de Ingreso: septiembre-2010
Mensajes: 498
Antigüedad: 13 años, 8 meses
Puntos: 5
Respuesta: duda de como poder hacer un remoto

seria algo asi

Código PHP:
Ver original
  1. <?
  2.  
  3. $ipuser = $_SERVER["REMOTE_ADDR"];
  4. $conn = @mysql_connect('localhost','el','dH5HXs') or sqlerror();
  5. mysql_select_db('test', $conn);
  6. $sql = mysql_query("SELECT 1 AS habilitado FROM ipaceso WHERE remot_ip={$ipuser}") or sqlerror();
  7. $host=mysql_fetch_array($sql);
  8. mysql_close($conn);
  9. if (!in_array($ipuser, $host)) {
  10. ?>
  11. <p>Tu Ip no tiene permiso para entrar a esta zona protegida.</p>
  12. <?php
  13. }else {
  14. ?>
  15. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  16. <html xmlns="http://www.w3.org/1999/xhtml">
  17. <head>
  18. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  19. <title>Ejemplo</title>
  20. </head>
  21. Bienvenido a la Zona Protegida <br />
  22. Tu Ip es: <? echo $_SERVER["REMOTE_ADDR"];?>
  23. <body>
  24. </body>
  25. </html>
  26. <?php
  27. }
  28. ?>