R0xxy Posted May 12, 2014 Share Posted May 12, 2014 during lesson time we're developing php systems and our topic is virtual storage like dropbox, google drive etc. My teacher has now set the task to enable the ability to share files within the server but also restrict access within the server folder. I'm being taught MySQL however I've read a lot about PDO being better and decided to use this method to try and get a higher grade for my project although I'm having difficulty understanding how to go about it what i want to achieve is: creating file sharing capability (i.e. students can share group projects) restricting users (only those working on a particular document can view it) don't worry this is not for my own benefit I'm just trying to get a grade here, I mainly just want advice on what I need I've read quite a bit but unfortunately I'm more of a visual learner. Quote Link to comment https://forums.phpfreaks.com/topic/288446-file-sharing-system-pdo-help/ Share on other sites More sharing options...
requinix Posted May 12, 2014 Share Posted May 12, 2014 MySQL and "mysql" are two different things. Yes, the capitalization can matter when talking about PHP. MySQL is the database engine where all your data goes. "mysql" is the name of an old PHP extension that you can use to access MySQL. PDO is also an extension for accessing MySQL (and other database engines) but has many benefits over "mysql". The only difference between mysql and PDO, that matters here, is the code you write to interact with the database. Everything else is the same - the file sharing, the group projects, the user restrictions... So you can go about the project like you were originally going to/intended to and all you need to change is that your code uses PDO instead of mysql. Now, while I commend you on learning about PDO and recognizing you should try to use that instead, don't let it weigh you down. If you've been taught mysql and its mysql_* functions then you may need to go with that. Like if you're pressed for time. It'll take you all of 2 minutes to ask your teacher about using PDO in the project - maybe s/he doesn't want you to because they only have the mysql stuff installed (since extensions require a bit of installation). On the other hand, maybe s/he'll be excited that you went out to learn something else and will give you extra credit for it. Dunno. Quote Link to comment https://forums.phpfreaks.com/topic/288446-file-sharing-system-pdo-help/#findComment-1479271 Share on other sites More sharing options...
R0xxy Posted May 12, 2014 Author Share Posted May 12, 2014 hi sorry i meant the old php syntax i would like to learn pro as it is a project and by extending my knowledge i can get a higher mark which i really want I'm just not sure how to go on about this file sharing system my teacher hadn't covered it in class she just set it as a task. been looking online but I'm sort of dyslexic and reading about code doesn't help me much i need visual guidelines do you know of any good tutorials or videos online i tried look in youtube and didn't find what i need thanks Quote Link to comment https://forums.phpfreaks.com/topic/288446-file-sharing-system-pdo-help/#findComment-1479274 Share on other sites More sharing options...
requinix Posted May 12, 2014 Share Posted May 12, 2014 (edited) I'm really not a tutorial or video kind of learner so I can't help you much there. Try breaking everything down into smaller pieces, one at a time. File sharing means that someone has to be able to upload a file, probably give it a name or description or something helpful like that, and then someone else has to be able to download it. So that's two questions right there: how do you upload files, and how do you make someone download a file? Then you need to find a way to restrict who can access the files. That means you have to be able to tell who the user is, and that means a sort of register/login system. Look for answers about how to make those. After that comes the problem of knowing whether the user can download a particular file, which means storing something in the database about which users can access which files. Don't forget your greatest resource: your teacher. Believe me when I say that most teachers love it when you come to them for help instead of just guessing your way through and making things up as you go. Edited May 12, 2014 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/288446-file-sharing-system-pdo-help/#findComment-1479291 Share on other sites More sharing options...
R0xxy Posted May 13, 2014 Author Share Posted May 13, 2014 I'm really not a tutorial or video kind of learner so I can't help you much there. Try breaking everything down into smaller pieces, one at a time. File sharing means that someone has to be able to upload a file, probably give it a name or description or something helpful like that, and then someone else has to be able to download it. So that's two questions right there: how do you upload files, and how do you make someone download a file? Then you need to find a way to restrict who can access the files. That means you have to be able to tell who the user is, and that means a sort of register/login system. Look for answers about how to make those. After that comes the problem of knowing whether the user can download a particular file, which means storing something in the database about which users can access which files. Don't forget your greatest resource: your teacher. Believe me when I say that most teachers love it when you come to them for help instead of just guessing your way through and making things up as you go. thanks its put it to an easier perspective i already have a register and login process working along with a file upload the next step is to enable a file download feature Quote Link to comment https://forums.phpfreaks.com/topic/288446-file-sharing-system-pdo-help/#findComment-1479357 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.