shashiku Posted July 25, 2007 Share Posted July 25, 2007 hi i tried the exec() to open a txt file. but iam not sure how to use it. can u pls help me this is the code i tried <?php exec(" C:\wamp\www\web\hello.txt"); ?> the notepad.exe seem to run in the task manager when i run the script. but the file doesnt open. pls correct me with the correct code Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 25, 2007 Share Posted July 25, 2007 Open a txt file: http://www.tizag.com/phpT/fileopen.php Write to a text file: http://www.tizag.com/phpT/filewrite.php Show the contents of the file: http://www.php.net/file Quote Link to comment Share on other sites More sharing options...
shashiku Posted July 25, 2007 Author Share Posted July 25, 2007 what i need is i want to the script to open the text file in the notepad it self. fopen only opens it in background. i want to execute the file. Quote Link to comment Share on other sites More sharing options...
plutomed Posted July 25, 2007 Share Posted July 25, 2007 <textarea cols="100" rows="20" name="edited_data"> <? $file = fopen("testing.php", "r") or die("Cannot open file"); while (!feof($file)) { echo fgetc($file); } fclose($file); ?> </textarea> ?> thats seemed to work for me. 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.