Session Var's outside store
I have my store in a directory www.mywebsite.com/rockstore
but my main website www.mywebsite.com/index.php i would like check to see if the person is logged into zencart.
i noticed the login/logout and my account uses this line of code
<? if (isset($_SESSION['customer_id'])) { ?>
but when i put that line of code into my main index.php it doesn't see that there is any existing session var's
i did print_r($_session); and there is no session var's when i do print_r from my main index.php but when i put print_r into my /rockstore/index.php it has this whole list of session vars.
can anyone point me in the right direction of what files i need to "include" and what not so that my main index.php i can check to see if the person is logged into zen cart.
thanks
Re: Session Var's outside store
You'll have to include includes/application_top.php
Re: Session Var's outside store
alright i put that in my main index.php and it says
Not Found
The requested URL /~paradigm/zc_install/index.php was not found on this server.
sorry.
Re: Session Var's outside store
true enough ... Zen Cart is designed to be run directly, not remotely. Thus all its paths are relative, and not absolute.
That error indicates it cannot find the configure.php files where it was looking.
Re: Session Var's outside store
so then is there "any" way i can do what i mentioned above?
Re: Session Var's outside store
If the files you're trying to run it from can be run from within the Zen Cart folder, it may be simpler, since Zen Cart is built around using relative paths, not absolute paths, to access its files.
Re: Session Var's outside store
Or you could just hack apart all the sessions functionality from within Zen Cart to duplicate it outside the cart... which can be an ugly process if you're not well-versed in PHP session coding.