Archive for the ‘Programming’ Category

Running PHP Script With Cronjob

Tuesday, November 3rd, 2009

It’s easy to configure a cron job in cpanel, in order to run a php script automatically. You must know the physical path of the script. That will be:

/home/username/public_html/folder/filename

Replace username, folders and filename.

And the php path, which will be /usr/local/bin/php

The command will then be:

/usr/local/bin/php -f /home/username/public_html/folder/filename

Configure the time settings. And it’s done.

Meta Refresh Redirect

Tuesday, November 3rd, 2009

If you need to redirect your visitors to a different webpage, one of the options available for that redirect is a meta refresh redirect. This code is normally used to refresh the webpage after a few seconds. But it’s also used for url redirects. You just lower the refresh interval to zero. In the example we have a interval of 5 seconds.

<html>
<head>
<meta http-equiv="refresh" content="2;url=http://www.domain.com/new-url.html" />
<title>This Webpage has moved</title>
</head>
<body>
The content of this webpage has moved. If you're not redirected to the new webpage in a few seconds, please click <a href="http://www.domain.com/new-url.html">here</a> to go to the new webpage.
</body>
</html>