/    Sign up×
Community /Pin to ProfileBookmark

PHP – daily update …Automatically??

Can I use PHP to update my site automatically. This is my situation…

I have a site where I upload content daily. This involves a file upload, and info going to a database. Pretty simple stuff.

What I want to be able to do is, instead of having to do this daily, just upload something like 10 files at one time, then have PHP ‘submit’ it to my site every day.

Is it doable? What do [I]you[/I] think?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@ZnupiAug 31.2007 — Of course it is doable. What you need is a cron job. It's a linux thing so if your server is on Windows, there's probably a way to do it but I don't know.

Another method would be writing a shell script or a command line php script that would run the submitting script daily at the given hour.

Your choice ?
Copy linkTweet thisAlerts:
@BhagyaAug 31.2007 — Ofcourse, It sounds Good !
Copy linkTweet thisAlerts:
@r_soleauthorAug 31.2007 — Awesome. So with cronjobs can I pretty much specify a time for a certain PHP script to execute?
Copy linkTweet thisAlerts:
@Markbad311Aug 31.2007 — Yes you can set up Cron's in cpanel to execute whenever you need it to. This is available in a simple and advanced form just create the script first it would probably be a good idea to use the database though let me explain:


1)add an active and a date field to the database table in which the info is already stored.


set2) you query to only return active records and not inactive records (1 for active 2 for inactive)

3)upload your ten files with active set to 2 and then place the date uploaded in the date field

4)in you cron job have the script set one of them to active where the date is > todays date and the active = 2 limit 1


5)have the job execute every night at midnight.

hope this helps
×

Success!

Help @r_sole spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...