Carbonized Blog

Just a bunch of stuff

Browsing Posts in PHP

I recently decided to try / review a new anti virus program I had heard about called Rising Antivirus. Now my first issue with this anti virus is the fact that the installer is over 60MB and the download was slow as hell. Took me around 30 minutes to download and I’m on a 20Mb connection. Once installed it takes over 200MB of hard drive space. First thing I did was run an update and it seemed to me that every component had an update and given I had only just downloaded the program this seems excessive. Next I ran a scan of the local drives. After twenty minutes I stopped it as it had only done about 5% and was saying it had over an hour left to go. Given this was my laptop with little on it this was far from acceptible.

Now we get to the main reason I swiftly uninstalled it. I downloaded the Eicar test file which is a standard file that all antivirus programs recognise as a test file so you can test if your antivirus is working or not. So I put the eicar.com file on my desktop and ran it. Rising Antivirus did absolutely nothing. I can accept it not detecting it during the download because my favourite free antivirus, AntiVir, only scans files when they are opened or read. To not detect the test file when run makes me wonder what else it doesn’t detect. I told it to scan the eicar.com file and it alerted me that it was a virus (well a test file which is what it should report it as) but not even a beep from Rising Antivirus when I run the file. In fact I had to turn Rising’s detection level up to high to get it to report it as a virus when I opened it. Even then I could see the command window in the background that eicar.com opens so I’m not even sure that if it had been a virus Rising Antivirus would of stopped it doing anything.

So my advice is avoid this anti virus like the plague. The best free anti virus, in my opinion, is AntiVir and the next best free one is Avast. I can no longer even recommend AVG as third place because all reports say as of version 8 AVG has become a resource hog that slows your computer down.

Ok I’ve been playing with Javascript frameworks like Jquery and Prototype. Now by default Jquery is 54KB and Prototype is 130KB (at the time of writing this). As you can see these are not small files. Now this is where gzip comes in. An easy way to describe gzip is that your server zips up the file before sending it to the web browser and the web browser then unzips it. Anyway by gzipping these two files using some PHP I have got Jquery down to 19KB and prototype down to 30KB!!!!

So we have Jquery:
Original Size: 54 KB
Gzipped Size: 19 KB
Data Savings: 64.81%

and prototype:
Original Size: 131 KB
Gzipped Size: 30 KB
Data Savings: 77.1%

All testing done using mod_zip test.

Anyway on to the code.
continue reading…

Ok been a while since I posted anything so thought I would post my tutorial on using the PHP mail() function. I have basically copied my tutorial word for word from the Lazarus forum.

This is a brief (or not) tutorial on using the PHP mail() function to send emails from your scripts.

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

Let’s break that down. The bool means that the PHP mail function returns either true or false depending on if it was successful or not. The rest is pretty self explanatory. string $to is where we put the email address we want to send to. string $subject is where we put the emails subject and string $message is where we put our message. The string part just means that this variable will be treated as a string when used. We will cover $additional_headers a bit later and won’t even touch on $additional_parameters.

Ok so we want to send an email to Bill Gates with the subject Windows Linux and our message is When is it coming out?. The function we would use looks like this

<?php
mail(‘bill.gates@microsoft.com’, ‘Windows Linux’, ‘When is it coming out?’);
?>

continue reading…

Powered by WordPress Web Design by SRS Solutions © 2010 Carbonized Blog Design by SRS Solutions