| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#11 (permalink) |
|
the one who was
Super #1
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
|
Bigjohn, how much experience do you have with PHP? I know of a way to do this, but would like to know where to start off with it for you.
__________________
Patrick Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org |
|
|
|
|
|
#12 (permalink) | |
|
minor deity
Super #1
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
|
Quote:
__________________
Proud to be a Surmunity Mod! XEON Make a fundamental difference! My Sites: Curious about Brewing Beer? Join the community! >>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax Get into an Art museum Victorian London It's your brain -ON WEB - mybrainhost.com (under development) What SHOULD Government do? Much Less than it Does! |
|
|
|
|
|
|
#13 (permalink) |
|
the one who was
Super #1
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
|
Ok, good... Then goto http://www.zend.com/zend/spotlight/c...lery-wade8.php and set that up. It's custom sessions that are stored in a database. Basics of it are simple, a cookie with the session ID is stored on the users computer, then the rest of the session is kept in a mysql database.
The basic premise of the idea that I have in mind is that you will store the cart items in an array via session variables. Something like $_SESSION['cart'][0] = item #1 etc... Then when you want to add items into the array/cart the code would look something similar to: Code:
$_SESSION['cart'][] = <new item variable here, however it is designed> Code:
foreach ($_SESSION['cart'] as $count => $item) {
echo "<html code outputting whatever format and the items description>";
}
__________________
Patrick Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org |
|
|
|
|
|
#14 (permalink) |
|
minor deity
Super #1
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
|
Excellent.
I'll have a look. Don't think I'll have a chance today... Can you email me at bigjohns at gmail? I want to discuss the stats problems I've been having on Pass5
__________________
Proud to be a Surmunity Mod! XEON Make a fundamental difference! My Sites: Curious about Brewing Beer? Join the community! >>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax Get into an Art museum Victorian London It's your brain -ON WEB - mybrainhost.com (under development) What SHOULD Government do? Much Less than it Does! |
|
|
|
|
|
#15 (permalink) |
|
Registered User
Seasoned Poster
Joined in Nov 2003
80 posts
Gave thanks: 0
Thanked 0 times
|
Here's basically what you need to do. Some of the code might be wrong, since I've spent the summer learning C++ instead of working on PHP.
This first file should be include()ed first thing, since it sets and modifies cookies. Code:
/* I'm assuming that the way you refrence paintings is by a unique print number, since there's only one piece of data per print you only need one cookie.
I'm also assuming that the user clicked a link to add the print to their cart, and the info was passed in the URI (example: mcdonoughfineart.com/index.php?printnum=574) */
$print_num = addslashes($_GET['printnum']);
$order = addslashes($_COOKIE['order_data']);
/* Now that you have the two pieces of data used by the program you need to determine what to do with them */
if ($print_num) { // If there is a print number
if ($order) { // If there is a cookie already
$order += ";$print_num"; // Append new print num to the order
/* The semicolon is placed in front of the $print_num so that numbers don't run together, this variable will be explode()ed later on */
} else { // No cookie exists, set a new one
setcookie('order_data,$print_num); /* Create a new cookie and include the oprder data */
} else { // If there is no print number do nothing
}
|
|
|
|
|
|
#16 (permalink) |
|
minor deity
Super #1
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
|
Thanks Nir. I'll look at that too.
Patrick - i replied to your email and it bounced!
__________________
Proud to be a Surmunity Mod! XEON Make a fundamental difference! My Sites: Curious about Brewing Beer? Join the community! >>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax Get into an Art museum Victorian London It's your brain -ON WEB - mybrainhost.com (under development) What SHOULD Government do? Much Less than it Does! |
|
|
|
|
|
#18 (permalink) |
|
the one who was
Super #1
Joined in Jul 2003
Lives in Memphis
1,967 posts
Gave thanks: 0
Thanked 3 times
|
Heheh, one-way email, the sure way to never receive spam again.
BJ, not quite sure why it bounced, but messages are coming through for me now again. Try it one more time and let me know.
__________________
Patrick Warnings: The program(s) might crash unexpectedly or behave otherwise strangely. (But of course, so do many commercial programs on Windows.) --www.gimp.org |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|