Article written by Chuckun on the Webmaster / SEO Blog On August - 5 - 2011
Check PHP files for minimum PHP version requirement
A very useful tool for many of you looking to release your scrips to the public, will be this PHP minimum version requirement checker.
If you ever plan on selling or distributing scripts, it’s vital that you let your customers know the server requirements of your scripts. Whilst telling them that your script might use the mod_rewrite Apache Module, or that it requires MySQL database, will be fairly easy to know, figuring out the PHP version requirements of your script is not straight forward, and certainly not an easy task if your script is quite complex.
Doing so would require that you write down EVERY PHP function that you use in your script, and then cross-reference to php.net to see what versions can use each function.
Well, say goodbye to that idea thanks to PHPduck! These amazing folks have created the script for the job!
Article written by Chuckun on the Webmaster / SEO Blog On June - 1 - 2011
Today, I’ll be showing you how you can easily protect your downloadable media.
Why would you want to do this? Well, often we want to hide the location of the downloads, to stop people leeching your content. And most measures can be easily swerved.
Here is a method I quite like. I have annotated everything for your convenience.
<?php$filename="downloaded.zip";// this is the fake name you want the downloaded file to be called.$source="/downloads/thefile.zip";// this is the real name and location of the file.if(file_exists($source)){// check that the real file exists, if so do the following..header('Content-type: application/zip');// set the content type of the current page to the type of file being downloadedheader('Content-Disposition: attachment; filename="'.$filename.'"');// Forge the download name by setting filename=readfile($source);// grab the real file to prompt download.}else{// if the file doesn't existecho"Error: File not found!";// display error message}?>
So how do we use this? going to the destination: mysite.com/download.php would grab the file ‘thefile.zip’ from the /downloads/ folder, and prompt you to download it, but with a new name of ‘downloaded.zip’
This is the simplest version of this method. Obviously with use of $_GET requests you can have download.php choose varying files from the /downloads/ folder. Example below:
<?php$id=$_GET['file'];$filename="downloaded-".$id.".zip";// will forge the name downloaded-5.zip (if download.php?file=5 is requested)$source="/downloads/thefile-".$id.".zip";// will pick the real file titled thefile-5.zip (if download.php?file=5 is requested)if(file_exists($source)){// check that the real file exists, if so do the following..header('Content-type: application/zip');// set the content type of the current page to the type of file being downloadedheader('Content-Disposition: attachment; filename="'.$filename.'"');// Forge the download name by setting filename=readfile($source);// grab the real file to prompt download.}else{// if the file doesn't existecho"Error: File not found!";// display error message}?>
It gets even more advanced once you start playing with more and more security. When dealing with premium ($$$) content, it’s good to use a database and give all your files a masked name, by MD5 encoding the names, storing them in a database with an assigned ID, and having download.php retreive the filename from the database to know which file to retreive. But that’d look a little messy for this tutorial!
Article written by Chuckun on the Webmaster / SEO Blog On May - 14 - 2010
Want to increase visitor duration on your AV Arcade powered games site?
I have the answer! And it is proven (totally legit, I’ll explain!)
The mod is called the Random Game Mod.. It basically creates a link to a mystery ‘random game’. If you encourage users to click this link when feeling indecisive about a game, they will keep on clicking it over and over and over. Meaning they will spend far more time playing games on your site than they would’ve if they didn’t know what game to play, and just left..
Visitor durations have been increased by up to 70% avg!!!