I would like to ask that how can I improve the security when I am using $_GET['something']; ?
I mean, how can I prevent people from executing these "gets" directly from the adress bar? Because I have a test page where you can obtain XP and from the XP you gain level.
It looks like this:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<label for="addxp"><font color="yellow">Add XP:</font></label> <input type="text" name="xpadd"><br>
<input type="submit">
</form>
$xpadd = $_GET['xpadd'];
mysql_query("UPDATE users SET xp=xp + '" . $_GET['xpadd'] . "' WHERE user_id='" . $_SESSION['user_id'] . "'") ;
it is working, but when I type this into my browser's address bar: http://mywebsite.com/xp.php?xpadd=50 it adds 50 xp to my points. Could someone please tell me how can I prevent that?