close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Using Session Variables to create a shopping cart selection system

Thread began 2/13/2023 7:53 am by yogastudents362523 | Last modified 2/22/2023 11:02 am by yogastudents362523 | 417 views | 7 replies

yogastudents362523

Using Session Variables to create a shopping cart selection system

Hello,

I am having trouble controlling Session Variables.

Your WebAssist Cookies menu item allows me to use the following example code snippet:

<?php
@session_start();
if (!isset($_SESSION["TemporaryCart"])) {
$_SESSION["TemporaryCart"] = "".($rsQueryRecordSet->getColumnVal("OnlyOneItem")) ."";
}
?>

But what I in fact want is the entire array of items in that initial query. But nothing I have tried does this successfully.


I believe, for marketing purposes, that it would be effective if people thinking of purchasing a ticket could preview classes and imagine what they might attend. But I do not want to grant database access to such unpaid and unvetted previewers. It would surely open me up to attacks of all kinds.

I have already created the kind of a "shopping cart experience" I want, and it is already available to my paid ticket holders. But it of course runs by putting their selections into a database. They can browse the entire set of Classes for that day, and then select 4 ... 2 to "livestream", and 2 for later on demand viewing. Those go into the database.


For unpaid people, I thought Session Variables would work better. So I just want to fill a Session Variable with all the classes for that day as extracted from my database. Then previewers can select them from the available items in Session. I can create subarrays of their selections??


But I unfortunately cannot get the results from an initial recordset query into a Session Variable I can manipulate,


I have attached a copy a file that I want to emulate. I also provide credentials for a live version on the server so you can observe what I have done in action if necessary.

I believe that once I get the above code snipper WebAssist Tools provide me working on an entire array, rather than on a single item, I will have the means to select single items from the resulting array, I think I will then be fine with the usual key => variable PHP system.

Thank you for your help.

Attached Files
cart_sessions_iyengar_daily_Mon.php

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...