sever3d Posted June 24, 2009 Share Posted June 24, 2009 Hi I am making small service with .swf movies to watch. I want to make files unavailable to watch for users thar aren't logged in. So ... You log in to my site - You have access to .swf file You are not logged in .... you can's see it All logged users don't have access to all files. just for files that they make account for. ex.I made my account to watch videos from one category and I can't watch any movie from any different category than that I have access. How to do that ? Maybe change chmod for files for user that have access to that file. Link to comment https://forums.phpfreaks.com/topic/163444-user-acces-to-files-after-login/ Share on other sites More sharing options...
MadTechie Posted June 24, 2009 Share Posted June 24, 2009 1. Create a login system, 2. add groups 3. apply to viewable options try googling for "php create login system" that should get you started Link to comment https://forums.phpfreaks.com/topic/163444-user-acces-to-files-after-login/#findComment-862374 Share on other sites More sharing options...
sever3d Posted June 24, 2009 Author Share Posted June 24, 2009 I know how to make login system. but how to restrict access to files on server anybody can insert path in web browser to file for example www.mywebsite.com/video/category/01.swf or www.mywebsite.com/zip/category/01.zip and watch or download movie. I want to restrict access to those files for not authorized users. Link to comment https://forums.phpfreaks.com/topic/163444-user-acces-to-files-after-login/#findComment-862391 Share on other sites More sharing options...
MadTechie Posted June 24, 2009 Share Posted June 24, 2009 Just use sessions ie <?php session_start(); //login check $_SESSION['UserGroup'] = $row['group']; //... ?> <?php session_start(); if($_SESSION['UserGroup'] < 2) //whatever! { die("No Access"); } header('Content-type: application/x-shockwave-flash'); readfile("../category/01.swf"); //folder outside/below the public folder ?> Link to comment https://forums.phpfreaks.com/topic/163444-user-acces-to-files-after-login/#findComment-862397 Share on other sites More sharing options...
sever3d Posted June 24, 2009 Author Share Posted June 24, 2009 readfile("../category/01.swf"); //folder outside/below the public folder ?? I have addon domain on my serwer /public_html/mydomain.com and inside that domain.com folde I have my website and that is root folder for that domain where should I make readfile("../category/01.swf"); //folder outside/below the public folder ? Link to comment https://forums.phpfreaks.com/topic/163444-user-acces-to-files-after-login/#findComment-862425 Share on other sites More sharing options...
MadTechie Posted June 24, 2009 Share Posted June 24, 2009 anywhere below public_html, ie /hidden/ <--here /private/SWF/ <--here etc Link to comment https://forums.phpfreaks.com/topic/163444-user-acces-to-files-after-login/#findComment-862543 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.