Packy Posted October 9, 2008 Share Posted October 9, 2008 Hi, I wanna edit one file on my server through it's web interface - it is configuration file for network adapter and I wanna change an IP address. I open file form my server: $open = fopen($file_path,"w"); and I save file with fwrite($open, $text);, but, it seams that it is not in the same form (or format) opened and closed. When I open original file from my ssh client, notepad do not show break lines just rectangles and all text in same line, but after edit with textarea and fwrite, it shows line by line - but format with line by line on the file looks like unrecognizable for system because linux wont read configurations from it and after reboot my network adapter is down. Thanks, Cheers. Link to comment https://forums.phpfreaks.com/topic/127693-fwrite-from-textarea-to-linux-file/ Share on other sites More sharing options...
xtopolis Posted October 10, 2008 Share Posted October 10, 2008 It's probably a line end difference.. Are you using Windows to update the file? If so, it's probably using different newline characters. If this is the case, in your php parsing script you will have to replace the /r/n (or whichever it's currently giving you) with the appropriate linux newline things..I don't know them offhand. Link to comment https://forums.phpfreaks.com/topic/127693-fwrite-from-textarea-to-linux-file/#findComment-661490 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.