I have two pages, the first is submitxp.php which looks like this:
Code: Select all
<?php include("../../tophead.php"); ?>
<form id="addxp" method="post" action="addxp.php">
<input type="submit" value="Add">
</form>Then addxp.php is this
Code: Select all
<?php
session_start();
include('../database.php');
$userid = $_SESSION['user'];
$query = "UPDATE `user` SET `xp`=(`xp`+100) WHERE `id` = $userid LIMIT 1";
$result = mysql_query($query) or die('Query Failed');
?>