TheRealL

Untitled

Aug 9th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. $code = file_get_contents("source.txt");
  4.  
  5. $code = str_replace("<", "&lt;", $code);
  6. $code = str_replace(">", "&gt;", $code);
  7.  
  8. echo "<pre>" . $code . "</pre>";
  9.  
  10. /*
  11. * Outputs:
  12. * <?php
  13.    $ip = $_SERVER['REMOTE_ADDR'];
  14.    $date = date("F j, Y");
  15.    $time = date("g:i a");
  16.    $file = fopen('ip_logg.txt', 'a', 1);
  17.    $text="IP: {$ip} - Dato: {$date} - Tid: {$time}\n";
  18.    fwrite($file, $text);
  19.    fclose($file);
  20.    echo "<center><b>Din IP adresse er logget<br>{$ip}</b></center>";
  21. ?>
  22.  
  23. */
Advertisement
Add Comment
Please, Sign In to add comment