Advertisement
Guest User

Edit.php

a guest
Dec 18th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. // Get the file name
  4. $file_name = $_GET['name'];
  5.  
  6. // Read file
  7. $file_read = fopen($file_name,"r");
  8.  
  9. // Get the contents
  10. $contents = fread($file_read, filesize($file_name));
  11.  
  12. fclose($file_read);
  13.  
  14. ?>
  15. <html>
  16.  
  17. <form action="edit_file.php" method="POST">
  18.          
  19.         <textarea name="edit" cols="100" rows="20"><?php echo $contents;  ?></textarea><p>
  20.         <input type="hidden" name="file_name" value="<?php echo $file_name; ?>">
  21.         <input type="submit" value="Save ME!">
  22.     </form>
  23.    <head>
  24. <style>
  25.   body {background-color:lightgrey}
  26. </style>
  27. </head>
  28. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement