TheJoey Posted September 7, 2009 Share Posted September 7, 2009 i have question about wether or not this can be done. Say i have a website with a login. And a user goes to click on something that requires a login that it will echo "refer = page" etc i am using sessions so would i just use Session([user_id]) (name of session) thanks in advance. Link to comment https://forums.phpfreaks.com/topic/173387-solved-php-question/ Share on other sites More sharing options...
bundyxc Posted September 7, 2009 Share Posted September 7, 2009 I'm not sure I completely understand... but something like this? session_start(); if (isset($_SESSION['user_id') { //User is logged in } else { //User is not logged in } Link to comment https://forums.phpfreaks.com/topic/173387-solved-php-question/#findComment-914016 Share on other sites More sharing options...
TheJoey Posted September 7, 2009 Author Share Posted September 7, 2009 Umm sorry, i wasnt to sure how to explain it. So ill use two different scenarios 1. Loggin in user can see all links and use the features on the website. 2. Non logged in user can browse but can only view the features. Link to comment https://forums.phpfreaks.com/topic/173387-solved-php-question/#findComment-914023 Share on other sites More sharing options...
bundyxc Posted September 7, 2009 Share Posted September 7, 2009 session_start(); if (isset($_SESSION['user_id') { print('Here, use these features!'); } else { print('Hey, you can't use these features until you register.'); } Link to comment https://forums.phpfreaks.com/topic/173387-solved-php-question/#findComment-914025 Share on other sites More sharing options...
TheJoey Posted September 7, 2009 Author Share Posted September 7, 2009 much thanks. yeh i was picturing doing something like that. just wasnt sure if it would work. Link to comment https://forums.phpfreaks.com/topic/173387-solved-php-question/#findComment-914026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.