Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- include "../include/header3.php";
- ?>
- <html>
- <body>
- <?
- echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>";
- ?>
- Name: <input type="text" name="name" /><br>
- Add/Subtract: <select name="change"/>
- <option value="add">Add</option>
- <option value="sub">Subtract</option>
- </select><br>
- Amount: <input type="text" name="amount"/><br>
- Description: <input type="text" name="description"/><br>
- <input type="submit" value="Submit Log" name="submit"/>
- </form>
- </body>
- <br>
- <br>
- </html>
- <?
- if (isset($_POST['submit'])) {
- $name = $_POST['name'];
- $name = strip_tags($name);
- $change = $_POST['change'];
- $amount = $_POST['amount'];
- $description = $_POST['description'];
- }
- if ($change == add) {
- mysql_query("Update APSLOG set Amount = Amount + '$amount', Description = '$description' WHERE Name = '$name'");
- echo "The points have been added";
- }
- else {
- mysql_query("Update APSLOG set Amount = Amount - '$amount', Description = '$description' WHERE Name = '$name'");
- echo "The points have been subtracted";
- }
- ?>
Add Comment
Please, Sign In to add comment