codrgii Posted March 5, 2010 Share Posted March 5, 2010 Is it possible in PHP to show a certain page and give the user an option to not display the page again and if they enable that option how would the page be able to not display the page to them again? How would this work out, and does anyone have any good examples for this? Quote Link to comment https://forums.phpfreaks.com/topic/194269-possible/ Share on other sites More sharing options...
salathe Posted March 5, 2010 Share Posted March 5, 2010 Yes, it is possible and there are a myriad of different ways to do something like this. Are you just thinking theoretically or do you have some script/application in mind where this would be useful? Quote Link to comment https://forums.phpfreaks.com/topic/194269-possible/#findComment-1021993 Share on other sites More sharing options...
codrgii Posted March 5, 2010 Author Share Posted March 5, 2010 I was just looking for some suggestions and examples, so it would give me an idea, what kind of input would be required, would it be something like $_POST['do_action'] for example? Quote Link to comment https://forums.phpfreaks.com/topic/194269-possible/#findComment-1022001 Share on other sites More sharing options...
freakstyle Posted March 5, 2010 Share Posted March 5, 2010 How you implement this feature really depends upon your website architecture. Do you have an off the shelf cms app, framework etc.. When you say a "user" do you mean someone who logged into your site, and you have a database of user data to pull from? Perhaps you just want any visitor to have that option? If that's the case then you need to determine how you want to approach the saving of that data and how it relates to the visitor. IE, do you want to create a database of user data and use the visitors Ip address as it's unique id? Maybe a cookie based solution would work better for you, this allows the data to be saved in the users browser for a variable length of time. Once you determine how and where you can or want to save that type of data for the user, you have to determine how a page is displayed and how do you want the user experience. Do you want the user to be redirected to another page if they land on the page they didn't want again? Do you just need to hide links to the pages? Do you want to alert the user they choose not to see that page, before or after you redirect them? Keep in mind too, that if you allow a user to set a preference like that, you should have a way for them to change that if they need to. Good luck Quote Link to comment https://forums.phpfreaks.com/topic/194269-possible/#findComment-1022134 Share on other sites More sharing options...
codrgii Posted March 6, 2010 Author Share Posted March 6, 2010 I'd be looking to save the info on cookies on their side, how would i start going about this? i have no idea where to begin as i wasn't sure this was possible in the first place, so some good examples would be a nice place to start Quote Link to comment https://forums.phpfreaks.com/topic/194269-possible/#findComment-1022406 Share on other sites More sharing options...
Zane Posted March 6, 2010 Share Posted March 6, 2010 you can either go with COOKIES or a simple boolean value in a database. Either one would suffice If you want this display option to appear everytime they login.. then use sessions instead. Quote Link to comment https://forums.phpfreaks.com/topic/194269-possible/#findComment-1022469 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.