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. Quote 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 } Quote 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. Quote 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.'); } Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/173387-solved-php-question/#findComment-914026 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.