Guest User

Untitled

a guest
Jul 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. //editServer.php
  3. $serverName = $_POST['serverName'] //assuming you have an html form previous
  4.  
  5. $filename = 'config.txt';  //the name of your file
  6. $string = "servername \"" . $serverName . "\"" ;
  7.  
  8. $fp = fopen($filename, 'w');
  9. fwrite($fp, $string);
  10. fclose($fp);
  11. ?>
  12.  
  13.  
  14.  
  15. /*************
  16. //Previous html form
  17.  
  18. <form action="editServer.php" method="POST">
  19. <input type="text" name="serverName" />
  20. <input type="submit" value="Edit" />
  21. </form>
  22.  
  23.  
  24.  
  25. *************/
Add Comment
Please, Sign In to add comment