Let's say I'm making a game where certain things - for instance, items - have IDs in their records.
Something like this:
CREATE TABLE items( id INT NOT NULL AUTO_INCREMENT, name TINYTEXT NOT NULL, ...properties, etc... PRIMARY KEY(id) )Now if I were to make a form where you can, for example "pick up" an item:
<form action='pickup.php' method='post'> <font color='green'>You have found this item:<br>[itemname]<br></font> <input type='hidden' name='itemID' value='[item ID from database]'> <input type='submit' value='Pick it up!'> </form>and now in the PHP file it gives the item to the user's own record in another table.
However, this is obviously far too insecure. Anyone could save and edit the form and hax my database by changing the ID in the hidden itemID field.
If anyone could help me work out a practical solution I would be very greatful.


Sign In
Create Account



Back to top









