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

saludos y gracias a todos los que me ofreceran su ayuda es que tengo este codigo

Código PHP:
Ver original
  1. <?
  2. $ipuser = $_SERVER["REMOTE_ADDR"];
  3. $host = array(
  4.       '192.165.25.66',
  5.       '154.25.26.3',
  6.       '70.45.68.130',
  7. );
  8. if (!in_array($ipuser, $host)) {
  9. ?>
  10. <p>Tu Ip no tiene permiso para entrar a esta zona protegida.</p>
  11. <?php
  12. }else {
  13. ?>
  14. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  15. <html xmlns="http://www.w3.org/1999/xhtml">
  16. <head>
  17. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  18. <title>Ejemplo</title>
  19. </head>
  20. Bienvenido a la Zona Protegida <br />
  21. Tu Ip es <? echo $_SERVER["REMOTE_ADDR"];?> Valido.
  22. <body>
  23. </body>
  24. </html>
  25. <?php }?>

y esta es la sql que estara en el otro servidor
Código SQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `ipaceso` (
  2.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  3.   `remot_ip` tinytext,
  4.   UNIQUE KEY `id` (`id`)
  5. ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

que busque si existe la ip en esa sql