Adding a string/variable to the users URL session

I am trying to add a string/variable to a users session when they click a button on the homepage it adds it to their session

I have some PHP I have written that changes the price on the website when “?personal” is in the URL and it works but I am unsure on how to get “?personal” added to the URL for the user’s session and remove it when they click the button again.

We currently have this on our current website that was built by another developer

Any help will be greatly appreciated.

Thanks in advance

Allowing a price change by manipulating the URL is a VERY bad idea. ANYBODY can change the price by modifying the URL. DONT DO IT!

Hi,

Sorry should have said it not an e-commerce website but a lead generator.

The url changes it to add vat nothing else

Thanks

Since buttons are on the browser and sessions are on the server you will have to send a new (POST) request to the server. for example you could place your button in a regular HTML form that post itself to the server. on the server you can add/update or remove session variables

Sponsor our Newsletter | Privacy Policy | Terms of Service