alexdee67 Posted July 13, 2010 Share Posted July 13, 2010 Is there a way to use php to fetch info from a .txt file off your computer. what if I have a program that updates a txt file. is there a way to read that off my computer and display it through the browser? Quote Link to comment https://forums.phpfreaks.com/topic/207571-php-getting-info-off-your-computer/ Share on other sites More sharing options...
Alex Posted July 13, 2010 Share Posted July 13, 2010 Sure. echo file_get_contents('C:\path\to\file\file.txt'); file_get_contents Quote Link to comment https://forums.phpfreaks.com/topic/207571-php-getting-info-off-your-computer/#findComment-1085213 Share on other sites More sharing options...
alexdee67 Posted July 13, 2010 Author Share Posted July 13, 2010 but it wouldnt display the info on your computer if I wanted you to see the file too? Quote Link to comment https://forums.phpfreaks.com/topic/207571-php-getting-info-off-your-computer/#findComment-1085517 Share on other sites More sharing options...
Alex Posted July 13, 2010 Share Posted July 13, 2010 It would read the file from the computer that PHP is running on. You can't access files on a client's computer. Quote Link to comment https://forums.phpfreaks.com/topic/207571-php-getting-info-off-your-computer/#findComment-1085519 Share on other sites More sharing options...
alexdee67 Posted July 13, 2010 Author Share Posted July 13, 2010 well I could build a database and have the text file update into the db then display it on the computer? Quote Link to comment https://forums.phpfreaks.com/topic/207571-php-getting-info-off-your-computer/#findComment-1085535 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.