cfgcjm Posted December 10, 2007 Share Posted December 10, 2007 I'm building a site which includes a "tip of the day" which is read from a text file. I'm making an interface which the admin can change the text through. My problem is i'm not going to have my interface files in the same directory as my textfile. Therefore i have the problem shown below because fopen() can't handle URLs. How do i specify a url to do this. Also...if the user inputs and apostrophe it is transformed to a "\" in the text file. Is there a way to fix that? <?php $data = $_POST['tip']; // Open the file and erase the contents if any $fp = fopen("www.digiconmediagroup.com/Homplate/tip.txt", "w"); // Write the data to the file fwrite($fp, $data); // Close the file fclose($fp); ?> Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted December 10, 2007 Share Posted December 10, 2007 fopen does support urls only you have to enable allow_url_fopen within the php.ini As for quotes getting turned in to \" or \' then disable magic_quotes_gpc. 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.