Jump to content

Form post to a session...how?


dwest

Recommended Posts

Say I have the following in a form:
[code]
<input type="text" name="text_name'.$r['item_id'].'[]" value="'.$r['name'].'" />
[/code]

When I post the form, what Am I posting to?  A form handler that then captures the posts and assigns them to the session?
Link to comment
Share on other sites

Now, I'm a little confused still.

In previous posts here (or perhaps another forum), I was told that passing hidden fields back and forth between forms was insecure and that I should use sessions instead.

But in order to get the values into a session I have to pass the hidden fields anyway.

So how do sessions alleviate the security vulnerabilities?
Link to comment
Share on other sites

I see that and thanks  :)

What I'm doing is creating a means for a user to build an invoice form and when satisfied, submit it to the database.

To do that, I have a submit button to add items and a submit button to save the invoice.

The user goes back and forth to the available items list by clicking the add items submit button.  She selects items from that list to add them to the invoice.  The values are posted back to the invoice as hidden fields.

Each click of the add items button, passes the items already selected, in hidden fields, to the items list form.  Clicking done on that form passes the new selections plus the existing selections, back to the invoice form.  All in hidden fields.

This goes on until the user is done and then all the items in the invoice form are posted to the invoice database.

So, is there any advantage gained from using sessions in this case?  Seems to clutter things up more unless I'm missing something. (which is highly probable I might add  ;) )
Link to comment
Share on other sites

I need to add that in the invoice form, all visible fields are seen as text boxes.  Thus they can be edited at any time.  So, the state of a piece of data gets posted "as is" not "as was".  This allows user to tweak the name or description or price of an item in the invoice and still add more items, etc.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.