Currently Browsing :: PHP



Dynamic thumbnails from websites (PHP Tutorial)

Posted by James Harvey at 3:20 PM on Dec 31, 2008
0 comments - Posted In: Tutorials | PHP

Since Alexa stopped offering their free thumbnail service last year a lot of thumbnail services are available now. Some of them offering limited free services and others only a paid premium version. On of the bigger and better services is Girafa, a thumbnail service with a free service and also premium services for users with more then 2000 image requests a month.

Read more...



Create custom backups from your website using cURL (PHP Tutorial)

Posted by James Harvey at 3:19 PM on Dec 31, 2008
0 comments - Posted In: Tutorials | PHP

These days I needed a script to backup only a part of a customers website using a CRON. Most of the control panels I know allow only a complete website backup and this is not what I needed. While plaaning the script, I thought about a solution for webmaster without full SSH access to their hosting account. A typical situation could be:

  • A shared hosting account that allows only backups for the whole site incl. database, emails and other settings
  • No administration rights via SSH
  • A FTP host for the storage of the the backup files
  • Support for cURL and a default PHP5 configuration (sorry no more code for PHP4).

Read more...



Preventing SQL Injection

Posted by James Harvey at 9:10 AM on Nov 27, 2008
0 comments - Posted In: Cold Fusion | PHP | SQL & MySQL

Most web applications interact with a database, and the data stored therein frequently originates from remote sources. Thus, when creating an SQL statement, you often use input in its construction. A typical SQL injection attack exploits this scenario by attempting to send fragments of valid SQL queries as unexpected values of GET and POST data. This is why an SQL injection vulnerability is often the fault of poor filtering and escaping, and this fact cannot be stressed enough.

I'm going to explains SQL injection by looking at a few example attacks and then introducing some simple and effective safeguards. By applying best practices, you can practically eliminate SQL injection from your list of security concerns.

Preventing SQL Injection in PHP & Coldfusion

Read more...



OSCommerce Free Contributions

Posted by James Harvey at 12:30 PM on Nov 18, 2008
0 comments - Posted In: PHP

These are some contributions I wrote for OSCommerce (2.2) and I'm mkaing them available here for download.

Read more...



URL Rewritting in PHP (PHP & SEO Tutorial)

Posted by James Harvey at 1:35 PM on Nov 14, 2008
0 comments - Posted In: Tutorials | SEO | PHP

In my endeavors to optimize the projects and sites I've worked on, I developed a simple snipplet of code that will easily adapt your long urls into an easier to remeber and easier to use method.

Let's take for example the url: http://yourdomain.com/index.cfm?view=blogid=4

Using the Code snipplet below we'll make that url look like this:
http://yourdomain.com/index.cfm/view/blog/blogid/4/

Read more...