Checkbox value as session variable to associate email

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
ServiceFly
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Sep 23, 2008 5:04 pm

Checkbox value as session variable to associate email

Post by ServiceFly » Wed Oct 28, 2015 3:31 am

Hello all,

I've researched this for 4 days now and have found too many solutions which none I've tried worked. 1st, I'm a moderate to novice PHP/JScript guy...

I have a checkbox which I after it is checked, or multiple are checked a filename value for each checkbox needs to be stored as a session until User registers or logs in. Once the user logs in their email and this filename needs to be inserted into a specific DB table. From this specific DB table the filename will be displayed when User logs in so they can download it. Yes, this is an enhancement to a cart, specifically J2Store (I have to use it).

The DB table will be called "download_variable" for this post.

I have successfully inserted the checkbox values into the DB table after submit, but no association is made to the User so this was a waste.

I've tried implementing Joomla's UserState Variables but not sure I'm doing anything right. I'm looking for suggestions on how to accomplish my need and some code snipets if you are so inclined. Thanks for all the help in advance.
Last edited by toivo on Wed Oct 28, 2015 6:37 am, edited 1 time in total.
Reason: mod note: moved from General Questions to 3.x Coding

ServiceFly
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Sep 23, 2008 5:04 pm

Re: Checkbox value as session variable to associate email

Post by ServiceFly » Wed Nov 11, 2015 1:53 am

Ok, since I have received no replies then I will ask this in steps. Step 1:

How do I set a session variable from a checkbox when it is selected? Please provide recommendations for the action for the submit button too.

Thanks to this community in advance for all help.

over
Joomla! Intern
Joomla! Intern
Posts: 83
Joined: Thu Jan 18, 2007 5:35 pm

Re: Checkbox value as session variable to associate email

Post by over » Tue Nov 24, 2015 10:44 am

Hi,
How do you link the user Guest to the logged in user? Two different php sessions.

Without knowing the solution - 2 not 100% reliable ideas.
- use cookies if the user allows it
- use IP address -> read up on the problems with getting reliable ones.

Remember that checkboxes are only sent to the server if set. ie needs special care if changed.


Locked

Return to “Joomla! 3.x Coding”