refiking Posted August 27, 2007 Share Posted August 27, 2007 Can someone point me in the right direction or tell me if it's at least possible. What I am trying to do is create a script that searches the local computer of the user and if a filename is there, it will upload it to the mysql database. Then, another script that searches for a filename on the database and if it's there, to ask the user if they would like to send it to their local computer. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/ Share on other sites More sharing options...
Wuhtzu Posted August 27, 2007 Share Posted August 27, 2007 A remote PHP server does not have access to your local file system, so you can't search local computer for a given file name. Think about the "security risk" it would pose if you could get you computer scanned by going to a random website... Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/#findComment-335542 Share on other sites More sharing options...
refiking Posted August 27, 2007 Author Share Posted August 27, 2007 It's not the entire computer. Just one directory and it's for my own business. The local computers being searched or all mine. There's no security breach if it's my own computer. And what about those programs that scan for ads and viruses. If they can scan for viruses, etc. Then, why can't I search a file directory? Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/#findComment-335569 Share on other sites More sharing options...
Wuhtzu Posted August 27, 2007 Share Posted August 27, 2007 It's just a fact that PHP running on a remote server can't access files on your local computer... Have you for example ever included a script located on your local computer (e.g. C:\Scripts\PHP\script.php) in a script run on a remote server? Have you ever opened files for reading or wrinting which are located on your local computer from a script run on a remote server? Of course it can be useful - I've just used PHP to rename a lot of images because I couldn't find any batch renaming program which did what I wanted. But to do stuff like that (access local files) you have to run PHP on your local computer - install Apache and PHP on your local computer and your are in business Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/#findComment-335581 Share on other sites More sharing options...
Jessica Posted August 27, 2007 Share Posted August 27, 2007 refiking, the programs you're referring to run on the computer, not on another server like PHP. You can't do it because it's a security risk in GENERAL. Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/#findComment-335583 Share on other sites More sharing options...
refiking Posted August 27, 2007 Author Share Posted August 27, 2007 Oh ok. Thanks for the explanation all. It is definitely appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/#findComment-335757 Share on other sites More sharing options...
Wuhtzu Posted August 27, 2007 Share Posted August 27, 2007 If it's for your own business, which is has to be for this to work, you could setup a FTP server on your local computer and make the directory in question available to PHP on what ever server you are running your scripts. Alternatively, as I said earlier, you can install a webserver (apache preferably) and PHP. Have a look at XAMPP if you are in a hurry: http://www.apachefriends.org/en/xampp.html Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/#findComment-335777 Share on other sites More sharing options...
MadTechie Posted August 28, 2007 Share Posted August 28, 2007 or an ActiveX, or a BHO.. which can't be written in PHP.. Quote Link to comment https://forums.phpfreaks.com/topic/66927-check-local-computer-script/#findComment-335844 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.