Jump to content

Manipulating POST variables between pages


tmoby8

Recommended Posts

Hi everyone,

 

I'm designing a small procurement cycle application. Typically, I select products on one page and pass them the selected to another page to decide their pricing. POSTing and reading checkbox array.

 

On this pricing page, I need to give functionality to add new & remove existing products.

How do I go about this?

 

My problem is, I need to choose new products and reload this page. When I remove a product, I do not have a trace of what products are left.

 

Thanks in advance.

 

Regards.

sounds like you are seeking the all mighty $_SESSION[] variable :D

 

Seriously though, if you want to keep variables for more that 1 page onto the next (that includes any page refresh) you should be using either session variables or a server side data store (such as flat file csv or database backend).  Session variables are by far the easiest to work with.  Just remember to declare the session open at the start of each page you need to use.

Thanks for the reply Muddy.

 

Do you mean, I put add the product IDs to SESSION and the manipulate it accordingly?

 

I think that would solve all the problems, and sounds easy to implement. I should only take care to unset the variable when not used.

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.