Another 4 day Problem Solved!
The script worked perfect! I am now trying to understand how it all comes together and then on to the next phase. Thanks for the tip on the quotes, I was wondering what the best method was since they both worked. Appreciate it!
Thank's Banfa, you are the man. Much respect
Mr. L8Knight
User Profile
Collapse
-
Summing specific values in a cookie array (newbie)
I am building a simple shopping cart and I am having problems trying to add the costs of the items to generate a total cost. I am new at this so forgive me if my technical verbiage isn’t the greatest!
I am trying to sum specific values in my arrays (or the price portions of the arrays). I have tried every imaginable way with the array_sum command and nothing has worked for me!
Here is what my cookie information... -
Problem Solved!!!
:D
Ok I finally figured this one out, first thank you to all that have helped me with this problem; I can’t express how much it is appreciated.
Here are the 3 working pages, hope someone else finds this simple, PHP form based shopping cart usefull!
Page 1 (index2.php)(th e Form, which starts a cookie to keep an incremental count (Key) for each opening)
<?php...Leave a comment:
-
Here is the serialized version and data it displays
Thank you for your response!
This is the code I am using for page 3. It is working just fine, but is displaying the data serialized.
<?php
echo "<br><br>";
if($_COOKIE["mycookie"]) {
foreach( $_COOKIE[mycookie] as $key => $value)
{
echo "Number...Leave a comment:
-
PHP Problem displaying unserialized data from cookie
Hello,
I am trying to build a simple php form based shopping cart using a cookie with arrays. I need to use 1 cookie because each order will have over 20 items. With that said, I realize I need to serialize the data to put the array into the cookie. That part of my code is working just fine and displaying fine. The problem I’m having is when I try to unserialize and display; the data does not appear. If I remove my unserialize command line...
No activity results to display
Show More
Leave a comment: