Advertisement
dandyraka

SGB QUOTE

Feb 12th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <center>
  2. <form method="POST">
  3.     QUOTE :<br>
  4.     <textarea rows="5" name="quote" id="quote" placeholder="Your quote" required></textarea><br>
  5.     IG USER :<br>
  6.     <input type="text" name="creator" placeholder="Your instagram username"><br>
  7.     <button name="submit" type="submit">SEND</button>
  8. </form>
  9. <?php
  10. if(isset($_POST['quote'])){
  11.     $myfile = fopen("quote.txt", "a+") or die("Unable to open file!");
  12.     if(!empty($_POST['creator'])){
  13.         $txt = $_POST['quote']."\n- ".$_POST['creator']."\n\n";
  14.     } else {
  15.         $txt = $_POST['quote']."\n- Unknown\n\n";
  16.     }
  17.     fwrite($myfile, $txt);
  18.     fclose($myfile);
  19.     echo "Your quote is saved.";
  20. }
  21. ?>
  22. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement