Guest User

Untitled

a guest
Oct 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. archivo 1:
  2.  
  3. require("control_errores.php");
  4.  
  5. $us3r2389=preg_replace('/[^a-zA-Z0-9]/' , '', $_POST['use']);
  6.  
  7. $p5554596=preg_replace('/[^a-zA-Z0-9]/' , '', $_POST['pass']);
  8.  
  9. if($us3r2389!=$_POST['use'] or $p5554596!=$_POST['pass']){
  10. $contenido="Contenido extranio en el archivo forum_/consultas/autentifi_car.php user: " . $_POST['use'] . " password: " . $_POST['pass'] . " Ip: " . $_SERVER['REMOTE_ADDR'] . " Nombre maquina: " . gethostbyaddr($_SERVER['REMOTE_ADDR']);
  11.  
  12. agregar_error($contenido);}
  13.  
  14. ============================================================================================================
  15. Archivo 2:
  16.  
  17. <?php
  18.  
  19.  
  20.  
  21.  
  22.  
  23. function agregar_error($contenido){
  24.  
  25.  
  26.  
  27.  
  28.  
  29. $aux=$contenido;
  30.  
  31. $contenido= "\r\n\r\n--". date("D, d / F / Y / H:i:s") . " ==> " . $aux;
  32.  
  33.  
  34.  
  35. $nombre_archivo="log.txt";
  36.  
  37.  
  38.  
  39. if (is_writable($nombre_archivo)) {
  40.  
  41.  
  42.  
  43. if (!$gestor = fopen($nombre_archivo, 'a')) {
  44.  
  45. echo "No se puede abrir el archivo ($nombre_archivo)";
  46.  
  47. exit;
  48.  
  49. }
  50.  
  51. //Escribir $contenido a nuestro arcivo abierto.
  52.  
  53. if (fwrite($gestor, $contenido) === FALSE) {
  54.  
  55. echo "No se puede escribir al archivo ($nombre_archivo)";
  56.  
  57. exit;
  58.  
  59. }
  60.  
  61. $msj= "&Eacute;xito, se escribi&oacute; ($contenido) al archivo ($nombre_archivo)";
  62.  
  63. fclose($gestor);
  64.  
  65. } else {
  66.  
  67. echo "No se puede escribir 2 sobre el archivo $nombre_archivo";
  68.  
  69. }
  70.  
  71.  
  72.  
  73. }
  74.  
  75.  
  76.  
  77. ?>
Add Comment
Please, Sign In to add comment