October 23, 2007

Automating Photoshop; Actions and Batching Explained

Filed under: Photoshop at 12:40 am — Comments (16)

If you work in Adobe Photoshop regularly, you’ll often find yourself engaged in repetitive loops that have a tendency to drain on your stamina and attention span. Today I’ll teach you how to use, and embrace the Action menu, a tool that will change the way you approach boring, monotonous tasks. Whether it’s mass resizing photos, embedding watermarks, adding filters, or perhaps something more or less complex, most of it can be automated.
(more…)

October 21, 2007

Protecting Your PHP/MySQL Queries from SQL Injection

Filed under: MySQL, PHP at 6:36 am — Comments (40)

SQL injection is a serious concern for webmasters, as an experienced attacker can use this hacking technique to gain access to sensitive data and/or potentially cripple your database. If you haven’t secured your applications, I implore you to get yourself familiar with the following method and grind it into your coding routine. One unsafe query can result in a nightmare for you or your client.

I’ve read through a lot of guides, and they tend to over complicate this, so I’ll be as straight forward as possible. In PHP the easiest way is to pass your data through the mysql_real_escape_string function. By escaping special characters on fields where the user can manipulate the database, you will avoid being vulnerable. Take a look below at the example of what to do and what not to do.

// This is a vulnerable query.
$query = "SELECT * FROM products WHERE name=’$productname’";
mysql_query($query);

// This query is more secure
$query = sprintf("SELECT * FROM products WHERE name=’%s’",
mysql_real_escape_string($productname));
mysql_query($query);

Since I primarily code in PHP, I can’t confidently provide techniques for other programming languages. The most important part of protecting yourself is stopping users from being able to pass unaltered database manipulative special characters, like single quotes.

MSDN - SQL Injection Article
Wikipedia - SQL Inection
SecuriTeam - SQL Injection Walkthrough
SitePoint - SQL Injection Attacks, Are You safe?

October 20, 2007

The Digg Effect - Can your hosting plan handle this? [Pic]

Filed under: Miscellaneous at 3:09 am — Comments (5)

Meta Titan traffic spike yesterday, I found this amusing:

Digg Effect

The fort held up, but it really puts it into perspective for those who are on penny and dime hosting plans.

October 18, 2007

CSS Builder - Brand New Meta Titan Tool

Filed under: CSS at 10:55 pm — Comments (2)

You’ve seen it done in programs like Adobe Dreamweaver, but believe it or not, there aren’t a whole lot of decent CSS generators in the flavor of my new tool (that I could find with a thorough Google search at least).

The Meta Titan CSS Builder provides a human readable interface for generating your selector (class/id/tag) code with valid syntax on the fly. Fill out the form, press build, copy the code, paste it into your stylesheet. I believe it will improve your productivity, especially if you’re a beginner / intermediate user and haven’t memorized all of the property names and appropriate values.

Give it a try, and a bookmark - click here!

This is the product of about 1 weeks worth of casual coding. I’m planning a version 2 that cleans up the interface a bit, and I’ll be taking suggestions on what I can approve.

October 16, 2007

How to Check Link Popularity in Google & Yahoo With PHP

Filed under: PHP, SEO at 4:31 pm — Comments (7)

Everyone knows that the best traffic you can get is organic, meaning people who come to your site naturally with genuine interest. Search engines like Google & Yahoo are notorious for placing a high value on the amount of websites that are linking to you. While their algorithms haven’t been completely unraveled yet, SEO specialists have a pretty good idea of how to make your site rank higher, and it usually starts with link building (assuming you have quality content first of course!).

The amount of links your site has indexed in Google & Yahoo can change often, so checking can be an arduous task. Luckily there are a ton of tools out there for this, but you’re not here for that, are you? You’re here because you want the code to run your own service, or maybe you want your own local copy of it, or maybe you just want to see how it works. The script below will check your backlinks in Google and Yahoo, as well as your Alexa rating. Feel free to modify and redistribute (non-commercially) as you see fit.

Live Demo | View Source Online

<?php
// Setting the URL variable
$link = $_GET['url'];

// Google Backlinks
function fetch_google($uri) {
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=link:'.$uri;
$v = file_get_contents($url);
preg_match('/of about \<b\>(.*?)\<\/b\>/si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}

// Yahoo Inlinks
function fetch_yahoo($uri) {
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://siteexplorer.search.yahoo.com/search?p=http://'.$uri.'&bwm=i&bwmf=s&bwmo=&fr2=seo-rd-se';
$v = file_get_contents($url);
preg_match('/of about \<strong\>(.*?) \<\/strong\>/si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}

// Alexa Rating
function fetch_alexa($uri){
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://data.alexa.com/data?cli=10&dat=snbamz&url=' . urlencode($uri);
$v = file_get_contents($url);
preg_match('/\<popularity url\="(.*?)" TEXT\="([0-9]+)"\/\>/si', $v, $r);
return ($r[2]) ? $r[2] : '0';
}

// Page Header
echo "<h2>Search Engine Popularity</h2>";

// Display Links and Information
if (isset($link)) {
echo "<strong>URL:</strong> " . $link . "<br />";
echo "<strong>Google Backlinks:</strong> " . fetch_google($link) . "<br />";
echo "<strong>Yahoo Backlinks:</strong> " . fetch_yahoo($link) . "<br />";
echo "<strong>Alexa Rating:</strong> " . fetch_alexa($link) . "<br />";
}

// Search Form
echo "<br />
<form action=\"linkcheck.php\" method=\"get\">
<input type=\"text\" name=\"url\" />
<input type=\"submit\" />
</form>";

?>

Complete List of HTML Tags

Filed under: HTML at 11:07 am — Comments (6)

A complete reference of every HTML tag available, good for any web developer - new or experienced. Several tags that have been deprecated have been omitted from the list. Click on each tag for more information and sample usages. This took about 4 hours, I hope you find it useful :)
(more…)

October 14, 2007

Collection of Small Icons for Web Development

Filed under: Web Design at 10:35 pm — Comments (29)

Whether you’re making an application or a web design, it’s useful to have a collection of high quality icons handy. Your users will appreciate the professional touch and ease of navigation that they bring. Over the years I’ve collected a ton of sets, I spent a couple hours digging through them all and compiling this. All downloads are hosted on my server in their original unaltered archives and include a mirror to the author’s website if applicable, this is a proactive measure in case their sites ever disappear.
(more…)

Startup Kit for Making Websites from Scratch

Filed under: CSS, HTML, PHP at 5:42 pm — Comments (2)

If you’re somewhat new to making websites, or if you’re like me and find yourself making new websites on a regular basis, whether it’s for work or something else, you might find this useful. I find it a chore to constantly make the same files when making a new website, so I’ve put together a basic startup kit that contains all the files/folders I usually need to get going with the development. Here’s what’s included:

index.php > With doctype & appropriate head tags defined.
robots.txt > With major search engines allowed by default, cgi-bin disallowed.
style/global.css > With a couple basic preset classes.
style/index.html > Blank file to disable directory browsing.
images/spacer.gif > 1×1 pixel transparent gif.
images/index.html > Blank file to disable directory browsing.

Download: http://www.metatitan.com/files/sitestartup.zip

Extract the zip and use these files as a starting point when making websites. There isn’t instruction included with these files, if you know what you’re doing you’ll know what to do with them. If not, I’ll probably have a guide for this eventually.

« Previous PageNext Page »