PDA

View Full Version : Pretty Simple PHP Question



Trigs
26-05-2009, 10:30 PM
I need a way to take the entire content of a certain webpage and save it every 30 minutes. So I guess the best way to do it would be by running a cronjob every 30 minutes that uses file_get_contents() and writes the contents to a txt file right?

Also is there a way to save the source code as well?

Jam-ez
26-05-2009, 10:51 PM
I'm not sure, but you could probably use fread to read all the contents then fwrite to write them into another file. :)

AlexBrooks
26-05-2009, 11:02 PM
I'm pretty sure you'd need to use a CRON job if you want to run it so often automaticly, can I ask why you want to do this? I always it a lot easier to help somebody when I understand what they want to do and why they want to do it. :)

Want to hide these adverts? Register an account for free!