anolan13 Posted December 4, 2010 Share Posted December 4, 2010 Hello all, I need to basically run a PHP file stored on a server when other specific files are modified, but only then. Is this possible with PHP? Thank you for the feedback, Quote Link to comment https://forums.phpfreaks.com/topic/220629-possible-run-file-on-event-from-server/ Share on other sites More sharing options...
trq Posted December 4, 2010 Share Posted December 4, 2010 Wouldn't have anything to do with php. incrond is what your looking for though, assuming your talking about a Linux OS. Quote Link to comment https://forums.phpfreaks.com/topic/220629-possible-run-file-on-event-from-server/#findComment-1142835 Share on other sites More sharing options...
QuickOldCar Posted December 4, 2010 Share Posted December 4, 2010 A better explanation of the types of files modified, when the action is to be taken place and upon what circumstance may help in determining this. One thing with php is that pretty much everything can imagine up is possible, but may be easier ways. As a first thought, I would say just to include() the php file under some type of if statement. Or possibly an ifexists, or checking the date modified. Just post the process here so everyone can get a better understanding of what exactly you would like to do. Quote Link to comment https://forums.phpfreaks.com/topic/220629-possible-run-file-on-event-from-server/#findComment-1142839 Share on other sites More sharing options...
anolan13 Posted December 4, 2010 Author Share Posted December 4, 2010 Here's a better explanation of what I'm trying to do. I work for a certain business that allows customers to use a sitebuilder product to create a website. Sometimes we would like to add certain things such as Google Analytics code, but unfortunately our host doesn't allow the sitebuilder to insert HTML directly. Also, if a customer edits the site outside of sitebuilder and then returns to sitebuilder it will overwrite the customization. I want to write a series of PHP scripts that will basically copy the files sitebuilder made (to the users specification), add in the desired code, and overwrite the existing file. I want this to be done after everytime a customer publishes their website with sitebuilder. I know how to create files etc. but I need to initially start the processes somehow. Remember, I cannot insert HTML or PHP to these pages, so there has to be some kind of trigger that starts this process. Otherwise I would just calls the code from within. I'm unsure of the approach to do this. I know its a bit confusing scenario but I do appreciate the responses, Quote Link to comment https://forums.phpfreaks.com/topic/220629-possible-run-file-on-event-from-server/#findComment-1143010 Share on other sites More sharing options...
trq Posted December 4, 2010 Share Posted December 4, 2010 Can you modify the sitebuilder at all to trigger these events? Quote Link to comment https://forums.phpfreaks.com/topic/220629-possible-run-file-on-event-from-server/#findComment-1143019 Share on other sites More sharing options...
anolan13 Posted December 5, 2010 Author Share Posted December 5, 2010 No it will have to an external file, etc. Quote Link to comment https://forums.phpfreaks.com/topic/220629-possible-run-file-on-event-from-server/#findComment-1143332 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.