Advertisement
Guest User

addlist.php

a guest
Oct 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <?php
  2. require "header.php";
  3. ?>
  4.  
  5. <div class="w3-main" style="margin-left:250px">
  6. <div class="w3-row w3-padding-64">
  7. <div class="w3-twothird w3-container">
  8.  
  9. <h1><b>Add List</b></h1>
  10. <h3>Items will be added to My List Today page</h3>
  11.  
  12.  
  13. <?php
  14. date_default_timezone_set('Pacific/Auckland');
  15. $date = date('m/d/Y');
  16. echo "<p><b>Date today:</b> New Zealand - " . $date. "</p>";
  17. ?>
  18. <br>
  19. <form action="includes/addlist.inc.php" method="post">
  20. <input type="text" name="list-item" placeholder="Add an item">
  21.  
  22. <button class="w3-button w3-green" type="submit" name="item-submit">Add</button>
  23. </form>
  24.  
  25. <?php
  26. if(isset($_GET['added'])){
  27. if($_GET['added'] == 'success'){
  28. echo 'Success. List updated!';
  29. }
  30. }
  31.  
  32. if(isset($_GET['added'])){
  33. if($_GET['added'] == 'error'){
  34. echo 'Error: Falied to add item. Try again.';
  35. }
  36. }
  37.  
  38. if(isset($_GET['error'])){
  39. if($_GET['error'] == 'emptyfields'){
  40. echo 'Error: Field is empty';
  41. }
  42. }
  43.  
  44. if(isset($_GET['error'])){
  45. if($_GET['error'] == 'toolong'){
  46. echo 'Error: Use less than 50 characters please.';
  47. }
  48. }
  49.  
  50. ?>
  51. </div>
  52. </div>
  53. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement