Posts Tagged ‘php’

PHP: MYSQL Database Backup Email Attachment Solution

August 3rd, 2008

In this post I will describe a database backup solution that I’ve been using for some time. Here’s what happens: this PHP script calls mysql to do a db_dump — this gets dumped to a text file — then it zips all this information up as a gunzzip file, then it emails the txt.gz file as an attachment to a gmail account (where you have unlimited storage). Easy!
» More: PHP: MYSQL Database Backup Email Attachment Solution

PHP: A script to increase a stat counter…

August 3rd, 2008

So, let’s say you have a stat counter on your website from Let’s say — sitedesigner.safesecureweb.com…. Or any other free web page counter for that matter…

Regardless, you will have a link to your counter that looks something like this:

http://sitedesigner.safesecureweb.com/servlet/CounterServer?_patternID=12&_userID=22533&_pageID=1

Now, we can dissect this link down and find the “userID” section of the URL or URI, whatever you fancy calling it.  Regardless — notice the “22533″ — Now, I don’t know who owns this counter, nor do I care — I’m just showing you a proof of concept.  For various reasons I created a little web form that would allow you to smack this counter (ie, make the hit # increase) N number of times, where N is a variable determined by the end user.

» More: PHP: A script to increase a stat counter…

How to download a remote file in php and then save it

December 8th, 2007

So, I found a site with all the lolcat images named cat1.jpg, cat2.jpg, cat3.jpg, etc. I wanted to know how many were there as I saw cat389.jpg. As it turns out, it’s only 390, so that’s all I need to know.

So, I decided to write a little PHP script to grab all the images. First, I set up a loop to do this, from 1-390. which is done like
» More: How to download a remote file in php and then save it