zero_ZX Posted March 28, 2009 Share Posted March 28, 2009 Hi all, I want my script to connect to my server and read a txt file, and display the content of that file on the people who uses my script's website. ie File is located at: http://scripts-for-free.com/version.txt Then a client's page will load the version.txt and display the content so they can see if there are any updates. But i dunno how to do this without include, and as simple as possible.. I tried this: $version = http://localhost/version.txt; echo $version; But it didn't work.. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/151540-solved-include-txt/ Share on other sites More sharing options...
PHP Monkeh Posted March 28, 2009 Share Posted March 28, 2009 Use: echo file_get_conents($version); Quote Link to comment https://forums.phpfreaks.com/topic/151540-solved-include-txt/#findComment-795918 Share on other sites More sharing options...
zero_ZX Posted March 28, 2009 Author Share Posted March 28, 2009 Thanks alot Final solution: $version = file_get_contents('http://localhost/version.txt'); echo $version; Quote Link to comment https://forums.phpfreaks.com/topic/151540-solved-include-txt/#findComment-795924 Share on other sites More sharing options...
MadTechie Posted March 28, 2009 Share Posted March 28, 2009 if your echo'ing it out directly after you could use readfile('version.txt') or even include('version.txt'); Quote Link to comment https://forums.phpfreaks.com/topic/151540-solved-include-txt/#findComment-795925 Share on other sites More sharing options...
redarrow Posted March 28, 2009 Share Posted March 28, 2009 If it a script your clients got, then this is correct. now add this to the code, place it on a page,and distribute the code. <?php $results=file_get_contents("http://scripts-for-free.com/version.txt"); echo $results; ?> Quote Link to comment https://forums.phpfreaks.com/topic/151540-solved-include-txt/#findComment-795928 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.