Guest Posted July 26, 2006 Posted July 26, 2006 Hello Everyone, I am running OsCommerce based store. I would like to have users go through their login.php page before accessing a specific page on the site. I know that when users try to access something like shopping_cart.php it will automatically boot them to login.php if they are not logged in (sessions or cookies). If they are logged in, then shopping_cart.php will come up just fine. My situation is a little bit different. I want members_only.php to be just like shopping_cart.php in that if they are not currently logged in, then they automatically get sent to login.php. If they have already logged in, and their sessions or cookies have not expired, then it will take them to members_only.php flawlessly. Is there some specific coding or somewhere you can point me to do this properly? Thanks,
Guest Posted July 27, 2006 Posted July 27, 2006 Any help? I believe it is only a small piece of coding?
Gil_e_n Posted July 27, 2006 Posted July 27, 2006 I'm not sure what, exactly, you want. But if you just want the people to be redirected from members_only.php unless they're logged in, add this line to the top of the page: // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } This is how osc does it, at least. I'm not seeing how what you're asking for differs from that? Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums. Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller
Guest Posted July 28, 2006 Posted July 28, 2006 I'm not sure what, exactly, you want. But if you just want the people to be redirected from members_only.php unless they're logged in, add this line to the top of the page: // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } This is how osc does it, at least. I'm not seeing how what you're asking for differs from that? Exactly what I was looking for. :) Now on to how to edit the registration page and what is required, and also add my own custom fields. :blink: Any quick comments on the easiest way to do that? (for example, I don't want any part of the address to be required, but I do want to add a column for example "hair color" that is required that it will store in the database.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.