Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

members only pages


Guest

Recommended Posts

i would like to put some of the pages to be only viewable by registered customers/members only

 

any way yo do this with osc?

Link to comment
Share on other sites

yes

 

if you mean users registered to the forum, then put the code below near the top of every page you want blocking (must be after "incude application_top" i believe as this loads the function- i think app_top is included in the header though so no real need to worry about this i dont think) - it will redirect them to the register/login page

 

if (tep_session_is_registered('customer_id')) {

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

always here to offer some useless advice....

Link to comment
Share on other sites

not working!

 

well i do not have a forum, but some images we would only like to show to those who have registered in osc

Link to comment
Share on other sites

on mine i have an include at the top of every page i want them to have to be logged in to visit

 

the included file contains this code:

 

 

---START CODE

 

require('includes/application_top.php');

 

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

----END CODE

 

it seems to work on mine :huh:

they are redirected to login on almost all pages if they have not logged in...

 

(note: if you do a similar thing then remember to remove the 'include application top.php from the page that you add this include to else it will error)

always here to offer some useless advice....

Link to comment
Share on other sites

---START CODE

 

require('includes/application_top.php');

 

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

----END CODE

 

or use

 

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'NONSSL'));

 

if you are not able to use SSL

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...