person1 Posted April 6, 2011 Share Posted April 6, 2011 Hi I have inherited a php/mysql site that I need to get functioning properly. The people that wrote it were very reluctant to hand over the files even though we had paid them in full. Anyhow, I have a file which I am pretty sure is designed to be run either manually or through a cron job on a certain day of the week (the word cron is actually in the file name). I am hoping for some help to change it so I can run it on any day so I can test the site. This file collects data from an xml feed and dumps the info we need into the db. $saturday = date("Y-m-d",strtotime("Today")); include("db.php"); From another file. I think this is where the variable $saturday is defined. $saturday = date("Y-m-d",strtotime("This Saturday")); if (date("D")=="Sat") $saturday = date("Y-m-d"); if (date("D")!="Sat" && date("D")!="Fri") $saturday = date("Y-m-d",strtotime("This Saturday")); Cheers Quote Link to comment https://forums.phpfreaks.com/topic/232835-script-designed-to-run-on-a-certain-day/ Share on other sites More sharing options...
monkeytooth Posted April 6, 2011 Share Posted April 6, 2011 well crons are scheduled runs. So if your looking to have it run any time or any day based on your choice I would figure it would be best to just copy the concept minus the date constraints to another file that you can just visit in your browser. But keep in mind the people who had made it originally may have done it on Sat for a specific reason, could be what ever the cron is doing is data intense and not something you just wanna run whenever, could be it connects to another system to get new data of which that system only updates once a week.. could be that same concept of connecting to another system where they system provider specifies in the terms you are only allowed to do it once a week, etc.. Im not familiar with your site or its code or what ever its true functionality is and the little code you shown is irrelivant per say to the need your describing. But thats only merely my own 2 cents. I could be wrong Quote Link to comment https://forums.phpfreaks.com/topic/232835-script-designed-to-run-on-a-certain-day/#findComment-1197658 Share on other sites More sharing options...
person1 Posted April 7, 2011 Author Share Posted April 7, 2011 Hi Monkeytooth Thanks for the reply well crons are scheduled runs. So if your looking to have it run any time or any day based on your choice I would figure it would be best to just copy the concept minus the date constraints to another file that you can just visit in your browser. How exactly would I do that? Do you think the bits of code I pasted what makes the script get the data for Saturday when run on a Friday? But keep in mind the people who had made it originally may have done it on Sat for a specific reason, could be what ever the cron is doing is data intense and not something you just wanna run whenever, could be it connects to another system to get new data of which that system only updates once a week.. could be that same concept of connecting to another system where they system provider specifies in the terms you are only allowed to do it once a week, etc.. Im not familiar with your site or its code or what ever its true functionality is and the little code you shown is irrelivant per say to the need your describing. But thats only merely my own 2 cents. I could be wrong It was designed to get data that is relevant for that day of the week but similar data is available from the same source on every day of the week. It is not a large amount of data at all. It is a free data source provided in xml. Quote Link to comment https://forums.phpfreaks.com/topic/232835-script-designed-to-run-on-a-certain-day/#findComment-1197990 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.