Guest User

Untitled

a guest
May 20th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. else if($_GET['action2'] == "news")
  2. {
  3. if(empty($_POST['submit']))
  4. {
  5. ?>
  6. <form method="post">
  7. Tytuł : <input type="text" name="title"><br>
  8. Text : <textarea style="width:300px; height:150px;" name="text"></textarea><br>
  9. <input type="submit" name="submit" value="Wyslij!">
  10. <?php
  11. }
  12. else
  13. {
  14. $title = $_POST['title'];
  15.  
  16. $text = htmlspecialchars($_POST['text']);
  17. $text = nl2br($text);
  18. $time = time();
  19. mysql_query("INSERT INTO `news` VALUES('NULL', '".$title."', '".$text."', '".$time."')");
  20. echo 'Newsa dodano!';
  21. }
  22. }
Add Comment
Please, Sign In to add comment