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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
deleet Posted August 17, 2009 Author Share Posted August 17, 2009 Great, thanks so much. Quote Link to comment 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.