Search Results

Add a false window to your wall

Posted in Random, Web Links  

If you’ve got an empty wall begging for a window but don’t want to break out the saw to put one in, or just can’t, you might want to look at one of these. It’s a set of blinds with lighting behind to simulate a window where one doesn’t exist.

wall-blinds.jpg

Download script using PHP

Posted in Programming  

This is a short PHP script that I use on my DailyFont.com site to handle downloads. Sure it's easy to just link to the zip, but this allows me to keep track of how many times each file has been downloaded which I then use to rank the fonts on popularity.

PHP:
  1. <?php
  2. include('shared.inc.php');
  3.  
  4. if (!is_numeric($_GET['id']))
  5. {
  6. die();
  7. }
  8.  
  9. $rs = mysql_query("SELECT file_name FROM table WHERE id='".$_GET['id']."' LIMIT 1");
  10. if (mysql_num_rows($rs)==0)
  11. {
  12. header("HTTP/1.0 404 Not Found");
  13. die();
  14. }
  15. $row = mysql_fetch_row($rs);
  16. $fhandle = fopen('files/'.$row[0], 'rb');
  17.  
  18. $zip_data = fread($fhandle, filesize('files/'.$row[0]));
  19.  
  20. header("Content-type: application/zip");
  21. header('Content-Disposition: attachment; filename="'.$row[0].'"');
  22. echo $zip_data;
  23.  
  24. //    Update download counter
  25. mysql_query("UPDATE table SET download_counter=download_counter+1 WHERE id='".$_GET['id']."' LIMIT 1");
  26. die();
  27.  
  28. ?>

The actual script uses a slug for each font similar to how WordPress uses the permalink structure. I decided to go this way rather than an id number because it would be neater. Plus the download link is /font_slug/download/ rewritten with a mod_rewrite call to this script.

I've seen lots of download management scripts that are called using something similar to download.php?filename=myfile.zip. This is potentially a really big security risk. If somebody typed in download.php?filename=/home/yourusername/.htpasswd they might be able to get your username and password. For that matter download.php?filename=/etc/httpd/conf/httpd.conf would pull up your Apache config file if your server isn't configured tightly enough.

Along the same security lines, lines 4-7 of the code above make sure that the id number passed is numeric to keep people from trying to send random commands to your database server.

osCommerce and duplicate content

Posted in Programming  

If you've got an osCommerce store set up you are probably fighting a duplicate content problem with the search engines. The problem is that OSC has an almost limitless number of ways to view any one particular product page - 1 for each category that the product is in plus one without any category information. The cPath variable in the query string is the culprint.

Here's how I got around it and my search engine traffic, as small as it is, has been growing. Read the rest of this entry »

Photoshop template blog

Posted in Blogging, Photography  

A few months ago I started my first ecommerce site at TikiTemplates.com where I have several Photoshop templates aimed at photographers available - some free, some for sale. And to try and draw a few visitors over there I've posted a couple times here with new templates. Fortunately I found a post on embedding WordPress in osCommerce and set up a new blog on my TikiTemplates.com site and this blog will get to go back to the random photography and PHP postings that fill up the most space.

A set of 4 spring Photoshop templates

Posted in Photography  

I spent some time in Photoshop today coming up with some spring themed templates for portraits, and I can up with a matching set of 4 with a dark blue border and orange flowers in the corners. They're not free like the last template I posted but they are either $1 or $1.50.

Sample spring Photoshop template

There is both a horizontal and vertical 4x6 and a horizontal and vertical 5x7.

List functions disabled in PHP

Posted in Programming  

I've got a web client having some really odd problems with a program of mine logging him out randomly. Normally I upload a phpinfo file and use that to see if I could find out anything but when I did that I got an error that phpinfo had been disabled for "security purposes". Read the rest of this entry »

Free 5 panel, simple white 11×14 Photoshop template

Posted in Photography  

This is a simple template I did for another site of mine and wanted to share it as a free template. There are two 5.5x4.5 inch openings on the bottom and three 3.33x3.5 inch openings across the top.

The template is saved as a PNG file with transparent areas for the 5 images.

A simple white Photoshop template

The template can be downloaded from TikiTemplates. Images are from iStockPhoto.

The history of minesweeper

If you are addicted to Minesweeper, or like me play in on your Palm to kill time, you should take a look at the History of Minesweeper.

Need a Starbucks fix right now

Posted in Computers & Internet  

Need a latte, but don't know where the nearest Starbucks is. Text your zip code to MYSBUX (697289) and it'll return the 3 closest Starbucks locations. If where you live is anything like Houston, they'll probably all be withing walking distance.

Deligio - Search engine for software

Looking for a new program, maybe a free php editor. A new search engine called Deligio may help you out. Enter what you're looking for an it'll bring up every program in its database that matches.

Read the rest of this entry »

« Previous Entries