deleet Posted August 16, 2009 Share Posted August 16, 2009 Hi all, I have a shopping cart that people can download from, but I didn't want anyone getting to it unless they had a "1" in the database under the "level" column. So I put this in: <?php session_start(); if ($_SESSION['level']!=1) {header over to register page instead} ?> But the thing is that someone who's patient can sniff out the store's actual URL and just get right to it and start downloading. Without needing anyone to code any of it, I'm just wondering what coding elements I should use to screen out people who aren't in the database with a "1" designation (paid), most likely on the same page. Thanks much. Link to comment https://forums.phpfreaks.com/topic/170478-security-on-a-download-page-that-has-a-session-further-down-already/ Share on other sites More sharing options...
Daniel0 Posted August 16, 2009 Share Posted August 16, 2009 Serve the file dynamically. This post should give you an idea of how to do it. If you are serving large files you shouldn't use readfile() though; it loads up the entire file in memory. You might want to use a combination of fopen, fread, feof and fclose to serve smaller chunks of the file sequentially instead. Link to comment https://forums.phpfreaks.com/topic/170478-security-on-a-download-page-that-has-a-session-further-down-already/#findComment-899318 Share on other sites More sharing options...
deleet Posted August 17, 2009 Author Share Posted August 17, 2009 Great, thanks so much. Link to comment https://forums.phpfreaks.com/topic/170478-security-on-a-download-page-that-has-a-session-further-down-already/#findComment-900467 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.