Guest User

Untitled

a guest
Feb 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?
  2. include "../include/header3.php";
  3. ?>
  4. <html>
  5. <body>
  6. <?
  7. echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>";
  8. ?>
  9. Name: <input type="text" name="name" /><br>
  10. Add/Subtract: <select name="change"/>
  11. <option value="add">Add</option>
  12. <option value="sub">Subtract</option>
  13. </select><br>
  14. Amount: <input type="text" name="amount"/><br>
  15. Description: <input type="text" name="description"/><br>
  16. <input type="submit" value="Submit Log" name="submit"/>
  17. </form>
  18. </body>
  19. <br>
  20. <br>
  21. </html>
  22. <?
  23. if (isset($_POST['submit'])) {
  24. $name = $_POST['name'];
  25. $name = strip_tags($name);
  26. $change = $_POST['change'];
  27. $amount = $_POST['amount'];
  28. $description = $_POST['description'];
  29. }
  30.  
  31. if ($change == add) {
  32. mysql_query("Update APSLOG set Amount = Amount + '$amount', Description = '$description' WHERE Name = '$name'");
  33. echo "The points have been added";
  34. }
  35. else {
  36. mysql_query("Update APSLOG set Amount = Amount - '$amount', Description = '$description' WHERE Name = '$name'");
  37. echo "The points have been subtracted";
  38. }
  39. ?>
Add Comment
Please, Sign In to add comment