Search found 86 matches

by Tony
Sun Nov 29, 2009 4:46 am
Forum: PHP & MySQL
Topic: How to Monitor Website using PHP
Replies: 0
Views: 2210

How to Monitor Website using PHP

If you have many domain names, and/or pointers to domains, that you do not visit at least daily you may want this script. It will tell you if your sites are having issues. For example, what if someone hacked your registrar and pointed your domain name to another DNS (yes, this actually happened to m...
by Tony
Sun Nov 29, 2009 4:45 am
Forum: PHP & MySQL
Topic: How to backup website automatically using PHP
Replies: 0
Views: 1672

How to backup website automatically using PHP

Here is a php script that will create a compressed backup of your website files, creating a different file each day for a month (then start over) so you have 30 days of backups. It will email you with a backup confirmation. Run it every night using cron to kick it off. You should download the backup...
by Tony
Sun Nov 29, 2009 4:43 am
Forum: PHP & MySQL
Topic: How to backup MySQL databases automatically using PHP
Replies: 0
Views: 1737

How to backup MySQL databases automatically using PHP

Here is a php script that will backup your MySQL database, creating a different file each day for a month (then start over) so you have 30 days of backups. It will email you with a backup confirmation. Run it every night using cron to kick it off. Replace the X's with your information. You should al...
by Tony
Sun Nov 29, 2009 4:41 am
Forum: PHP & MySQL
Topic: How to Find File and Directory Sizes using PHP
Replies: 1
Views: 2379

How to Find File and Directory Sizes using PHP

This php script will search any directory (and all subdirectories under that directory). It will show you the total size of the directory, number of files in the directory, and identify any files > or = to the size specified. When you run this script you will be prompted for the unix directory name ...
by Tony
Sun Nov 29, 2009 4:40 am
Forum: PHP & MySQL
Topic: How to Delete session files using PHP
Replies: 0
Views: 1588

How to Delete session files using PHP

If you are using a custom php.ini file to specify a user directory where session files are stored, this script can be used to delete old session files (the system will not purge them, so the directory will keep growing if you do not delete them). You must change the $sessionDir variable to the path ...
by Tony
Sun Nov 29, 2009 4:39 am
Forum: PHP & MySQL
Topic: How to Search and Replace using PHP
Replies: 0
Views: 1641

How to Search and Replace using PHP

For when you need to find that variable or string in all your files. Or when you need to change the name of a variable in all your scripts. These Search and Replace scripts operate on all the files of a given type an any directory. The way the scripts are written you cannot use the # character in th...
by Tony
Sun Nov 29, 2009 4:37 am
Forum: PHP & MySQL
Topic: How to use Cron
Replies: 0
Views: 1568

How to use Cron

Cron is used to execute a script or command at a specified interval or point in time. The control file is a crontab file. A crontab file is made up of one line per entry. An example crontab entry looks like this: 0 * * * * php $HOME/cron.php >>$HOME/cron.log 2>>$HOME/cron.err In the above example, t...
by Tony
Sun Nov 29, 2009 4:33 am
Forum: Web programming
Topic: How to keep your website secure
Replies: 0
Views: 1794

How to keep your website secure

Do not use ftp. Use sftp (secure ftp). If you have a forum or use other off-the-shelf scripts, create a subdomain as another site (package). Then the forum will be isolated from the rest of your website. If someone does hack their way in, they cannot reach anything except that forum. It is those op...
by Tony
Sun Nov 29, 2009 4:29 am
Forum: PHP & MySQL
Topic: How to clean your PHP scripts
Replies: 0
Views: 1747

How to clean your PHP scripts

Scripting in php can get very messy. Typically you build your html as you go, so you have your php logic and your html all mixed up. IMHO, a better way is to separate your html from your php logic. Then you can edit your html page in a standard html editor, and work on your logic independently. This...
by Tony
Sun Nov 29, 2009 4:28 am
Forum: PHP & MySQL
Topic: How to delete php.ini files using PHP
Replies: 0
Views: 1639

How to delete php.ini files using PHP

You can find another Tip on this page for how to create a custom php.ini file. And another for how to populate directories with your php.ini file in the event your host requires you to have one in each directory with php scripts. But then if you want to delete all the php.ini files, you may need thi...

Go to advanced search