michaelpalmer7 Posted July 13, 2008 Share Posted July 13, 2008 Hi all, I'm fairly new to php and have just really been messing about (successfuly) with sendmail forms, so i know the basics. I was wondering is there a way to update part of the text in a html file by submitting it from a website form with a sendmail file. Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/ Share on other sites More sharing options...
dannyb785 Posted July 13, 2008 Share Posted July 13, 2008 can you give an example? Your question wasn't entirely clear. What are you looking to do? Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588957 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 sorry, ill try and make it clearer.. im trying to be able to update the text displayed on my website from a seperate web page rather than messing about offline. cheers.. btw. thanks for the quick reply. Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588959 Share on other sites More sharing options...
dannyb785 Posted July 13, 2008 Share Posted July 13, 2008 Do you mean updating information possibly from a database? Or css/html structure for a template? Or what exactly Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588963 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 Hi i would like to have a textbox displaying part of the text on the website, allowing me to edit the text in that textbox, hit submit and the coding in the sendmail file replaces that part of the text in the html page with the text submitted in the textbox. cheers Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588964 Share on other sites More sharing options...
dannyb785 Posted July 13, 2008 Share Posted July 13, 2008 Trust me, you don't want/need to be able to update a .htm, .php, .txt, etc file with just a textbox that will overwrite what you currently have. If someone else got ahold of it, it'd be done. The best way to do this(if you insist on not just modifying the files and uploading via ftp) is to have your site, and pages, database driven. So you basically would log into your site, pick which page you want to edit, then it'd display the html in a textarea and you'd edit, submit, and it'd update the page. Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588967 Share on other sites More sharing options...
DeanWhitehouse Posted July 13, 2008 Share Posted July 13, 2008 database is your best bet, you should have it like this database table. page content then just query to call the details from that, and then have a form to update and add details to the db Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588969 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 Hi thanks for the info, however i am not that worried about the security issue as it is gonna be edited by anyone that reads it, a bit like wikipedia. so that side reall isnt a problem for me. Is there a way to do what i proposed? many thanks Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588972 Share on other sites More sharing options...
DeanWhitehouse Posted July 13, 2008 Share Posted July 13, 2008 i just said Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588976 Share on other sites More sharing options...
discomatt Posted July 13, 2008 Share Posted July 13, 2008 Hi thanks for the info, however i am not that worried about the security issue as it is gonna be edited by anyone that reads it, a bit like wikipedia. so that side reall isnt a problem for me. Is there a way to do what i proposed? many thanks Security is a big deal, actually. Unless you don't care about XSS attacks or your site being hijacked and used to advertise illicit sites or farm passwords. And yes, there is a way to do what you proposed... I'm confused though... do you want to do it via email? Or via a webform on the same server the 'modified' page is hosted on? Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588977 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 hi discomatt. I would like to do it with a web form which will be on a seperate server Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588980 Share on other sites More sharing options...
discomatt Posted July 13, 2008 Share Posted July 13, 2008 I don't suggesting doing this. You're going to need code on the server with the modifiable file ( we'll call this server 1 from now on ) anyways, you might as well put the form on that page... But if you don't you can simply submit to an 'action' page on server 1 that will modify the file for you. Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588982 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 thanks for the info. if i put the page on the same server could you give me an example of the php code i would need to submit an update to a page. cheers. Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588987 Share on other sites More sharing options...
discomatt Posted July 13, 2008 Share Posted July 13, 2008 Did you want it to modify the whole page, or only parts of it? Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588990 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 only the visible text parts of a page.. Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-588991 Share on other sites More sharing options...
dannyb785 Posted July 13, 2008 Share Posted July 13, 2008 Even if your site is like wikipedia, you've GOT to have it database driven because a) when new pages need to be created but more importantly b) if a user is screwing around(or accidently) and deletes everything on the page, you need a way to not only recover the data lost, but track which user made which changes. Or else you'll have some troll surf your site and delete all your pages and you have no idea who did it, Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-589034 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 sorry, mentioning wikipedia was a bad idea. it is going to be on a page in no way connected to my website (that is being updated) so only i will know where it is... Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-589049 Share on other sites More sharing options...
dannyb785 Posted July 13, 2008 Share Posted July 13, 2008 if you are the only one editing and viewing a page, why even put it on a server? Why not just create a .htm file to be viewed on your computer? then you can edit it as needed without needing an internet connection Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-589050 Share on other sites More sharing options...
michaelpalmer7 Posted July 13, 2008 Author Share Posted July 13, 2008 the page i was talking about was the "update" page that updates my website. Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-589062 Share on other sites More sharing options...
michaelpalmer7 Posted July 14, 2008 Author Share Posted July 14, 2008 The page i was talking about was the "update" page that updates my website. Quote Link to comment https://forums.phpfreaks.com/topic/114533-web-page-updater/#findComment-589647 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.