hilda Posted December 8, 2008 Share Posted December 8, 2008 I have a small website and I need people to update text on the site. I created text files for them to just type what they need and upload it then a simple PHP include would publish this and everything would work great. My issues is that some dont know how to use a editor or even an FTP program. So i am thinking of making an interface to log into and just query this file, edit it and then save it. I was wondering if anyone had any ideas. It seems very simple and as I have taken on more role and duties I am not sure how much time I will have to create this. Is there anything I can search for or something out there I can buy for cheap or use. Thanks for the help. DJ Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/ Share on other sites More sharing options...
rhodesa Posted December 8, 2008 Share Posted December 8, 2008 I would recommend looking into one of the MANY open-source content management systems (CMS) that are out there. popular ones are Joomla & Drupal. I am also a fan of cmsMadeSimple. Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709685 Share on other sites More sharing options...
hilda Posted December 8, 2008 Author Share Posted December 8, 2008 Thank you for the update but I would rather stay away from CMS. I would rather find a way to simple edit these 5 files. I have to make sure that these users keep working on that one file not the entire page. I look at our dev site and it's a mess. I would rather some admin panel that they can login and edit or upload to this text file. Any thoughts? Thanks Derek Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709708 Share on other sites More sharing options...
revraz Posted December 8, 2008 Share Posted December 8, 2008 Why not just provide a form for them to do the same thing? Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709798 Share on other sites More sharing options...
chronister Posted December 8, 2008 Share Posted December 8, 2008 revraz is right, it would be easier to just allow then to do it through a form. If you don't want to build a full out login system, you could allow those users to "share" a password and hard code it in a text doc or something to that effect. That is really not a good way to do it, but it would work depending on your security needs. Nate Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709820 Share on other sites More sharing options...
hilda Posted December 8, 2008 Author Share Posted December 8, 2008 Agh yes. That would be easier.. Thanks for the help. nNow it's time to get making forms. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709855 Share on other sites More sharing options...
rhodesa Posted December 8, 2008 Share Posted December 8, 2008 Quote revraz is right, it would be easier to just allow then to do it through a form. If you don't want to build a full out login system, you could allow those users to "share" a password and hard code it in a text doc or something to that effect. That is really not a good way to do it, but it would work depending on your security needs. Nate i would use an .htaccess/.htpasswd file instead of hardcoding a password in Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709872 Share on other sites More sharing options...
hilda Posted December 8, 2008 Author Share Posted December 8, 2008 Ok I did that but I have one issue. how do I get rid of the "\" when punctuation is used? Like tonight's looks like tonight\'s. Can I create something into the form that will help me? Thanks again for the help. Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709890 Share on other sites More sharing options...
chronister Posted December 8, 2008 Share Posted December 8, 2008 stripslashes() will remove them. Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709897 Share on other sites More sharing options...
revraz Posted December 8, 2008 Share Posted December 8, 2008 Sounds like you have magic quotes on? Check out stripslashes and addslashes instead. Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709899 Share on other sites More sharing options...
hilda Posted December 8, 2008 Author Share Posted December 8, 2008 Sorry foolish quesiton but how and where do I use that stripslashes in my form/code? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709966 Share on other sites More sharing options...
revraz Posted December 8, 2008 Share Posted December 8, 2008 http://us2.php.net/stripslashes Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-709970 Share on other sites More sharing options...
hilda Posted December 9, 2008 Author Share Posted December 9, 2008 Ok I went through that link but I a m still a little confused. I am trying to use this in a form not a DB. I was wondering do you have a quick example I can view on that? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-710470 Share on other sites More sharing options...
thecard Posted December 9, 2008 Share Posted December 9, 2008 Sounds like you should read a bit more into php tbh but anyways: So a user enters some text into a form and their comment/article is stored in the global variable $_POST (or $_GET). $string = $_POST['article']; stripslashes($string); Now your string won't have the unnecessary \s. Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-710475 Share on other sites More sharing options...
rhodesa Posted December 9, 2008 Share Posted December 9, 2008 the slashes are probably coming from an OLD feature of PHP called magic_quotes. basically addslashes() is automatically run on all form data (for outdated security reasons). using stripslashes() will undo what PHP is automatically doing, but since magic_quotes is depreciated and won't be in PHP6, you should look into disabling it all together: http://us.php.net/manual/en/security.magicquotes.disabling.php Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-710483 Share on other sites More sharing options...
hilda Posted December 9, 2008 Author Share Posted December 9, 2008 I guess we al start somewhere. I have been reading online and trying to learn this myself. I did try that but it did not work. I posted my snippet of code below <?PHP $filename = "nfl.txt"; $text = $_POST['nfl']; stripslashes($text); $fp = fopen ($filename, "w"); if ($fp) { fwrite ($fp, $text); fclose ($fp); echo ("The Update has been Posted"); } else { echo ("The Update has not been Posted"); } ?> Again thank you for the help Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-710492 Share on other sites More sharing options...
revraz Posted December 9, 2008 Share Posted December 9, 2008 Which is exactly what I said above Quote the slashes are probably coming from an OLD feature of PHP called magic_quotes. basically addslashes() is automatically run on all form data (for outdated security reasons). using stripslashes() will undo what PHP is automatically doing, but since magic_quotes is depreciated and won't be in PHP6, you should look into disabling it all together: http://us.php.net/manual/en/security.magicquotes.disabling.php Quote Link to comment https://forums.phpfreaks.com/topic/136102-question/#findComment-710493 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.