Form POST or sessions?

Posted by eddienotizzard on Stack Overflow See other posts from Stack Overflow or by eddienotizzard
Published on 2011-01-07T19:50:03Z Indexed on 2011/01/07 19:53 UTC
Read the original article Hit count: 140

Filed under:
|

If you have an item where you allow users to add comments, how can you pass which item the user is replying too?

I've though of using a hidden field in a form, however this can be easily changed using plugins such as firebug:

<form method="post" action="blah">
<input type="hidden" name="item_id" value="<?php echo $item_id; ?>">
<!-- other form data here -->
<input type="submit" name="submit">
</form>

Or just simply using a session:

$_SESSION['item_id'] = $item_id

Is there a safe way to send the item data in a form?

© Stack Overflow or respective owner

Related posts about php

Related posts about form