Hello everyone,
I'm having trouble with PHP sessions. I have Zen Cart installed in my server, when you log into zen cart, it creates a session named zenid with an integer variable customers_id and stores the ID # of the logged in user.
I need a very small script written that will:
1) Detect if there's an open zen cart session (from the zenid cookie)
2) If there's an open zen cart session, display the contents of customer_id session variable
3) If there's no open zen cart session, create one and set the customer_id to a value hardcoded into the script
That's it! I'm very easy to work with, and this can be a quick and easy rating and payment.
Thanks,
Ben
* * *
UPDATE: I want to add some more information here to help with your bidding, when I'm logged into Zen Cart, I can add:
print_r($_SESSION);
to zencart's [login to view URL] and it will output the contents of all the session variables including customer_id, the one I need.
If I create a script in the same folder of the same domain with these contents:
<?php
session_name('zenid');
session_start();
print_r($_REQUEST);
print_r($_SESSION);
die();
?>
It will output the session id (zenid) in the $_REQUEST contents, but the $_SESSION is always empty, even though the $_SESSION will display fine from inside zencart.
Thanks,
Ben
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
PHP 4, Zen Cart (1.3.x or whatever the latest version is)