Advertisement
IWBH_01

HTMLpful

May 29th, 2020 (edited)
998
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>HTMLpful</title>
  4. </head>
  5. <body>
  6. <?php
  7.  
  8. if(isset($_POST["fdat"])&&isset($_POST["fnm"])){
  9.  $fi=fopen($fnm=$_POST["fnm"],"w");
  10.  $sta=$fi&&1;
  11.  $sta=$sta&&(fwrite($fi,($fdat=$_POST["fdat"])));
  12.  fclose($fi);
  13.     if($sta){ echo "did."; }else{ echo "fail."; }
  14. }else{
  15.   $fnm=""; $fdat="";
  16. }
  17.  
  18. ?>
  19. <br>
  20.  HTMLpful<br>
  21. <form method="post">
  22.     file name:<input type="text" name="fnm" value="<?php echo $fnm; ?>" >
  23.     <br>
  24.     file data:<br>
  25. <textarea style="width:400pt;height:200pt" name="fdat"><?php echo $fdat; ?></textarea>
  26. <br>
  27.     <input type="submit" value="save">
  28. </form>
  29.   <br>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement