Sunday, April 5, 2009

Clickbank Security Using PHP

by: Robert Plank


Here's a way to protect the products you sell with Clickbank, using their built-in protection and by implementing a 30-day expiration, all without having to worry about managing databases or customer lists.


THE FIRST STEP

First of all, Clickbank protection is decent as it is. If you want to keep your customers from passing the thank you page URL around to friends, there are a couple of things you can do.

Login to your Clickbank account: http://www.clickbank.com/login.html

At the top there's a link that says "Click HERE to modify your account". Click on the link.

On this page there are two links at the top, but one says "Click HERE to modify your account." Click on this one.

You should be at the page that allows you to edit the prices of all your Clickbank products. Scroll down to the bottom where it says:

Secret key (up to 16 letters & digits)

You should see a text box here. If it's empty, choose a secret key, type it in and remember it. It can be anything you want, but it should be different than your Clickbank password.

"COOKIE CUTTER" TOOLS

If you've looked around the Clickbank site you'd know that Clickbank offers some friendly pieces of code in a few different programming languages like Perl and PHP that can help you protect your downloads. Basically this is what happens:

* Your order link contains what's called a "seed". This is just a word or a piece of text, which can be anything you want.

* Your customer clicks on the order link and pays.

* Clickbank takes that seed, and uses your secret key on it -- basically mashes the two together and does a bunch of crazy stuff to come up with a garbled piece of junk. But this a garbled piece of junk that can ONLY come from this seed and secret key. You change the value of the seed or secret key even a little and this "hash" changes.

* The seed and the hash are passed back to the thank you page where your Clickbank script sits. (We have the secret key added to your script, and it never changes, so it doesn't need to be handed to us by Clickbank.) This Clickbank script takes the seed and the secret key and does the same crazy shit Clickbank did to us to compute your own hash.

Clickbank calls this their "cbpop" or Clickbank Proof of Purchase.

The hash was something we figured out on your own and the hash Clickbank are compared. If they match, we're in business because the customer here really did buy from us.. The customer can't figure this out on his or her own because they never actually saw the secret key. (And no, you can't "reverse" a hash to figure out the original secret key.)

If you get nothing out of what I just told you, remember this: it's almost impossible for anyone to figure out the right Proof of Purchase code without that secret key.

USING SOMEONE ELSE'S CODE

This is the PHP function they give us:

function cbValid($seed, $cbpop, $secret_key) {

// A bunch of stuff in here...

}

This function cbValid takes three parameters: $seed, $cbpop, and $secret_key. The script goes through that last step of ours I explained above, does the crazy shit and then compares the result to the one given to us by Clickbank.

Now we need to figure out what to do if your customer really didn't pay. The easiest thing to do, is just stop the script in its tracks, preventing the page under it from loading.

if (!cbValid($seed, $cbpop, $secret_key)) die();

The exclamation point means "not". We're saying, first try this...

cbValid($seed, $cbpop, $secret_key)

.. pass the seed, proof of purchase, and secret key into your black box. If the function tells us NO, do the rest. In this case, "die". Die stops everything immediately, so if you have HTML or PHP code below that line, it won't be looked at if the Clickbank validation fails.

The "proper" way to grab $seed from the query string is this way:

if (!cbValid($_GET["seed"], $_GET["cbpop"], $secret_key)) die();

You could also redirect the user to an error page of yours if you like:

if (!cbValid($_GET["seed"], $_GET["cbpop"], $secret_key)) {

header("Location:http://www.your.host/error.html");

die();

}

Instead of $seed and $cbpop we use $_GET["seed"] and $_GET["cbpop"]. This is because the variables don't appear magically out of thin air, they really appear in the URL as http://www.your.url/test.php?seed=SOMESEED&cbpop=SOMEPOP. We want these values to be taken out of the URL.

USE MINE

Here's a zip file containing your cb.php script: http://www.jumpx.com/tutorials/clickbank/cb.zip

Save it, unzip it, and open cb.php. Near the top should be a line such as:

$secret_key = "YOUR_SECRET_KEY";

Change YOUR_SECRET_KEY to that secret key you set in the Clickbank control panel.

Now, for usage... your thank you pages will have to end in .php here. Like, thankyou.php (and now it doesn't matter if they have obvious names or not -- because they'll be thoroughly inaccessible to thieves. Remember, you can simply rename your HTML pages so they end in .php and they'll still work just fine.

Put this line at the top of you thank you page script:

Be sure to upload cb.php to the same folder as your thank you page. Now, when someone goes to the thank you page, the first thing the thank you script will do is run everything in cb.php, and cb.php will take the data Clickbank has passed to see if it matches.

You're going to have to change your Clickbank order links a little. This is what they should look like now:

http://www.clickbank.net/sell.cgi?link=YOUR_CLICKBANK_ID/YOUR_PRODUCT_ID/YOUR_PRODUCT_NAME&seed=YOUR_SEED

Replace YOUR_CLICKBANK_ID with, of course, your Clickbank ID and YOUR_SEED with the seed you want to use. This can be anything, something simple that's short and one word like the product name. But NOT your secret key.

YOUR_PRODUCT_ID is the number Clickbank shows to the left of each thank you page as you add it. When you're testing, be sure to set the price at $0.00. Once everything's in place you can raise the price of the item to $19.95 or $29.95 or whatever it's priced at.

http://www.clickbankguide.com/merchant.htm#account will explain everything if you're a Clickbank newbie.

COULDN'T THE DOWNLOAD URL, HASH, AND RECEIPT BE SHARED?

You can't prevent sharing completely... after all, your customer can always download the file and share the file, not the download URL, to friends. We can do one thing to give these would-be freeloaders a bit of a headache, and that is expiration.

Here we can say, 30 days after someone buys your product, the thank you page will be inaccessible to them. If they buy on October 25th, they can bookmark and revisit that thank you page up until November 25th at the exact time they made their purchase. It's kind of a nice compromise because it gives honest people enough time to get what they need but at the same time it becomes impractical to share the URL.

In chapter 9 of my book, Simple PHP (http://www.simplephp.com), I explained how time works on computers, they use a big number which is just a count of how many seconds have passed since January 1st, 1970. I also explained that there was a function, called strtotime(), which we could use to determine this "number" or timestamp of a certain date. For example, 30 days ago or 1 year ago.

30 days sounds about right. To figure out the Unix timestamp of this moment, minus 30 days is:

strtotime("-30 days")

Now, to store it in a variable called $expire:

$expire = strtotime("-30 days");

But you're saying, how do I know when these people purchased? I don't have that kind of information. Aha! But you can. Remember, the seed you put in your order links can be anything you want. So let's just make it the timestamp of this exact moment.

When the customer revisits the thank you page, they can't change the seed, because as I mentioned, if you change *either* the seed or the secret key, the resulting hash (proof of purchase) will be different. So you see, they're stuck with it. But, the current time always changes!

All we have to do, in cb.php, are these two steps:

* Figure out what the timestamp was exactly 30 days ago, and store this value in $expire.

* Compare the seed and $expire. If the the value of the seed is less than that of $expire, it means that the product was purchased more than 30 days ago and the visitor shouldn't be given access to the page. Die.

We've already taken care of step one by saving the timestamp 30 days prior in $expire. Now, we compare the seed (it's $_GET["seed"], remember, because we're grabbing it out of the URL string) and $expire like:

if ($_GET["seed"] Order Now

Instead of YOUR_SEED we want PHP to call the function mktime(), which gives us the current timestamp, and output it, using echo.

echo mktime();

Now just put around it...

And shove it in there.

">Order Now

Now setup a link for $0.00 in your Clickbank control panel and try it. You can be sure it works by changing that "-30 days" in strtotime to "-5 minutes". Then try accessing the download page, then wait 5 minutes and try again. Neat, isn't it?

You say, I've done this, but I have more than one product. How do I keep someone from grabbing everything once they've grabbed one?

Have your links look like the following: ">Order Now

This way the seeds will look like "stringbeans445433" if you're selling stringbeans. Then again if you're selling corn on the cob on another sales page, you can change "stringbeans" to "cornonthecob". Now the seeds for each product will be different.

Those seeds won't be all numbers, will they? So, in cb.php, do this:

$timestamp = ereg_replace("[^0-9]","",$_GET["seed");

I won't go into a lot of detail about pattern matching, but the [^0-9] means "NOT anything from 0 to 9. It basically goes through every letter and number of $_GET["seed"], and if what's there isn't a 0, 1, 2, etc. it's replaced with nothing (hence the ""). The final result is saved in a variable called $timestamp.

Since now we're looking at $timestamp and not $_GET["seed"], let's change that if-statement:

if ($timestamp

When I extracted the timestamp from the seed, I simply removed all characters that were not numbers, leaving just the numbers contained within that string. Now I want to do the opposite. Here's an example seed:

test1074482258

I take out all the numbers and am left with "test". Next I figure out which script called cb.php (which is stored in the variable $_SERVER["SCRIPT_NAME"]). Then the script takes out everything up to the last slash (/) and everything before the first dot (.). If the script was located at "/clickbank/test.php", all that's left is "test".

If you give each thank you page a different name, and make sure all your seeds reflect the correct page, i.e. if your thank you page is called "carrots", the part of that order link containing the seed should appear as:

&seed=carrots

If you don't care how Clickbank's protection works, that's your derogative. Just get the zip file and follow the instructions I've provided in cb.php.

As far as scripts that handle several Clickbank products -- I can't recommend any at this time, since I've never across any good ones. (But you should check out Harvey Segal's free site, ClickbankGuide.com, which can answer most of your questions about Clickbank.)

Here's that script again in case you missed it: http://www.jumpx.com/tutorials/clickbank/cb.zip

Make sure to read the instructions I've supplied in cb.php, get everything setup and on your web server, and you'll be well on your way to having bulletproof protection on your Clickbank products.

:: +/- :: Read more...

Simple Solution for Php Includes - IFrames

by: Michael J Medeiros


I have recently created my first Php program. I wanted to share with others some of the problems that I encountered, and how I finally overcame these obstacles.

My Reason for needing a Php Include

To start, my most recent website features a free classified advertising solution, a modified version of PhpBB stripped to function as an Article Bulletin Board (No replying), and a link directory. The business model of my Website offers free Classified Advertising, but charges a small fee for enhanced advertisements (Featured, Bolded, and Better Placement). The Classifieds were purchased from a developer, so I had little experience with the application. The link directory was a free resource of an old program that I modernized a bit. I choose the old link directory because the links are clean. They are not replaced with coding to count outbound traffic. I figured this would increase the value of links, to sites who exchanged links with me.

To increase revenue on the new site, I realized that I needed to increase the value of, “Featured Advertisements”. To do this I wanted to randomly rotate featured advertisements, from the classifieds, across my Bulletin Board and Link Directory. Bare in mind, all three are run from a unique table, and I wanted to leave it that way. In addition, I had little experience with the development for all three applications.

I started reading tutorials and utilizing Forums to create a Php program for external pages on the site. The program would pull a random featured ad from the classified table. This program only took me about 32 hours to create, while performing research. I didn't intend to get into the schematics of the program with this post, so forgive me if you are looking for a Random generator. But I would be more than happy to share my code upon request.

The code I created was simple, it worked just the way I wanted, but I ran into one cumbersome obstacle; how do I implement this easily across two unique table driven applications? The answer was to use a Php Include

I started reading tutorials on, "Php includes and functions and classes". I realized quickly that this was a bit more confusing than creating the actual coding. In addition, I ran into parsing errors if I included the new coding in only one application.

My solution to using the, "Include ()," Php function

I found that very few people were willing to provide any feedback for such a problem, even in the most resourceful forums for Php Coding and information resources. I fumbled with the coding for over 72 hours. I thought this was a bit ridiculous, as the code itself took less time to create.

I finally came across a helpful solution that may prove beneficial, if you are in the same situation with Php Includes. The code was uploaded onto my server as a file (something.php). I removed the standard, "Php Include ()," function from all links and the PhpBB coding. I then called the Php file (page) using an Iframe tag, on pages I wanted it to appear. This proved to be a successful replacement for the Php Include.

Search Engine Results Using Iframe for Php Include

I waited until Google came around to see how the Iframe affected my sites search rankings. Finally, the other day this happened. The conclusion, my search rankings still increased due to recent link exchanges. The code is working to my needs, and it is easily included on any page that I want, even externals outside my site can call on the code, which opens more doors for advancement.

Here is the simple Iframe code I used to replace the Php Include:

iframe valign="right" marginwidth="0" marginheight="0" hspace="0" vspace="0" src="http://your.com/file-to-include.php" align="top" scrolling="no" width="600" frameborder="0" height="105"> /iframe


Using the Iframe tag for Php Include Conclusion

I have encountered no problems with including my PHP code on pages across external servers, using the iframe as a Php Include. As you can see, it is totally customizable. You can specify the width, height, alignment, border, scrolling, margins and more. The only obstacle that I have encountered, is the style sheet that the site, or page, with the, "Php Include," is not utilized. The page that the code is on seems to need its own unique style sheet.

I hope this proves beneficial to anyone having trouble with running a "Php Include" across various unique online applications.

:: +/- :: Read more...

Developing State-enabled Applications With PHP

by: John L


Installment 1

Developing State-enabled Applications With PHP

When a user is browsing through a website and is surfing from one web page to another, sometimes the website needs to remember the actions (e.g. choices) performed by the user. For example, in a website that sells DVDs, the user typically browses through a list of DVDs and selects individual DVDs for check out at the end of the shopping session. The website needs to remember which DVDs the user has selected because the selected items needs to be presented again to the user when the user checks out. In other words, the website needs to remember the State - i.e. the selected items - of the user's browsing activities.

However, HTTP is a Stateless protocol and is ill-equipped to handle States. A standard HTML website basically provides information to the user and a series of links that simply directs the user to other related web pages. This Stateless nature of HTTP allows the website to be replicated across many servers for load balancing purposes. A major drawback is that while browsing from one page to another, the website does not remember the State of the browsing session. This make interactivity almost impossible.

In order to increase interactivity, the developer can use the session handling features of PHP to augment the features of HTTP in order to remember the State of the browsing session. The are basically 2 ways PHP does this:

1. Using cookies
2. Using Sessions

The next installment discusses how to manage sessions using cookies...

Installment 2

Cookies

Cookies are used to store State-information in the browser. Browsers are allowed to keep up to 20 cookies for each domain and the values stored in the cookie cannot exceed 4 KB. If more than 20 cookies are created by the website, only the latest 20 are stored. Cookies are only suitable in instances that do not require complex session communications and are not favoured by some developers because of privacy issues. Furthermore, some users disable support for cookies at their browsers.

The following is a typical server-browser sequence of events that occur when a cookie is used:

1. The server knows that it needs to remember the State of browsing session
2. The server creates a cookie and uses the Set-Cookie header field in the HTTP response to pass the cookie to the browser
3. The browser reads the cookie field in the HTTP response and stores the cookie
4. This cookie information is passed along future browser-server communications and can be used in the PHP scripts as a variable

PHP provides a function called setcookie() to allow easy creation of cookies. The syntax for setcookie is:

int setcookie(string name, [string val], [int expiration_date], [string path], string domain, [int secure])

The parameters are:

1. name - this is a mandatory parameter and is used subsequently to identify the cookie
2. value - the value of the cookie - e.g. if the cookie is used to store the name of the user, the value parameter will store the actual name - e.g. John
3. expiration_date - the lifetime of the cookie. After this date, the cookie expires and is unusable
4. path - the path refers to the URL from which the cookie is valid and allowed
5. domain - the domain the created the cookie and is allowed to read the contents of the cookie
6. secure - specifies if the cookie can be sent only through a secure connection - e.g. SSL enable sessions

The following is an example that displays to the user how many times a specific web page has been displayed to the user. Copy the code below (both the php and the html) into a file with the .php extension and test it out.

[?php
//check if the $count variable has been associated with the count cookie
if (!isset($count)) {
$count = 0;
} else {
$count++;
}
setcookie("count", $count, time()+600, "/", "", 0);
?]

[html]
[head]
[title]Session Handling Using Cookies[/title]
[/head]
[body]
This page has been displayed: [?=$count ?] times.
[/body]
[/html]

The next installment discusses how to manage sessions using PHP session handling functions with cookies enabled...

Installment 3

PHP Session Handling - Cookies Enabled

Instead of storing session information at the browser through the use of cookies, the information can instead be stored at the server in session files. One session file is created and maintained for each user session. For example, if there are three concurrent users browsing the website, three session files will be created and maintained - one for each user. The session files are deleted if the session is explicitly closed by the PHP script or by a daemon garbage collection process provided by PHP. Good programming practice would call for sessions to be closed explicitly in the script.

The following is a typical server-browser sequence of events that occur when a PHP session handling is used:

1. The server knows that it needs to remember the State of browsing session
2. PHP generates a sssion ID and creates a session file to store future information as required by subsequent pages
3. A cookie is generated wih the session ID at the browser
4. This cookie that stores the session ID is transparently and automatically sent to the server for all subsequent requests to the server

The following PHP session-handling example accomplishes the same outcome as the previous cookie example. Copy the code below (both the php and the html) into a file with the .php extension and test it out.

[?php //starts a session session_start(); //informs PHP that count information needs to be remembered in the session file if (!session_is_registered("count")) { session_register("count"); $count = 0; } else { $count++; } $session_id = session_id(); ?] [html] [head] [title]PHP Session Handling - Cookie-Enabled[/title] [/head] [body] The current session id is: [?=$session_id ?] This page has been displayed: [?=$count ?] times. [/body] [/html]

A summary of the functions that PHP provides for session handling are:

1. boolean start_session() - initializes a session
2. string session_id([string id]) - either returns the current session id or specify the session id to be used when the session is created
3. boolean session_register(mixed name [, mixed ...]) - registers variables to be stored in the session file. Each parameter passed in the function is a separate variable
4. boolean session_is_registered(string variable_name) - checks if a variable has been previously registered to be stored in the session file
5. session_unregister(string varriable_name) - unregisters a variable from the session file. Unregistered variables are no longer valid for reference in the session.
6. session_unset() - unsets all session variables. It is important to note that all the variables remain registered.
7. boolean session_destroy() - destroys the session. This is opposite of the start_session function.

The next installment discusses how to manage sessions using PHP session handling functions when cookies are disabled...

Installment 4

PHP Session Handling - Without Cookies

If cookies are disabled at the browser, the above example cannot work. This is because although the session file that stores all the variables is kept at the server, a cookie is still needed at the browser to store the session ID that is used to identify the session and its associated session file. The most common way around this would be to explicitly pass the session ID back to the server from the browser as a query parameter in the URL.

For example, the PHP script generates requests subsequent to the start_session call in the following format:

http://www.yourhost.com/yourphpfile.php?PHPSESSID=[actual session ID]

The following are excerpts that illustrate the discussion:

Manually building the URL:

$url = "http://www.yoursite.com/yourphppage.php?PHPSESSID=" . session_id();
[a href="[?=$url ?]"]Anchor Text[/a]

Building the URL using SID:

[a href="http://www.yoursite.com/yourphppage.php?[?=SID ?]"]Anchor Text[/a]

:: +/- :: Read more...

Mastering Regular Expressions in PHP

by: Dennis Pallett


What are Regular Expressions?

A regular expression is a pattern that can match various text strings. Using regular expressions you can find (and replace) certain text patterns, for example "all the words that begin with the letter A" or "find only telephone numbers". Regular expressions are often used in validation classes, because they are a really powerful tool to verify e-mail addresses, telephone numbers, street addresses, zip codes, and more.

In this tutorial I will show you how regular expressions work in PHP, and give you a short introduction on writing your own regular expressions. I will also give you several example regular expressions that are often used.

Regular Expressions in PHP

Using regex (regular expressions) is really easy in PHP, and there are several functions that exist to do regex finding and replacing. Let's start with a simple regex find.

Have a look at the documentation of the preg_match function (http://php.net/preg_match). As you can see from the documentation, preg_match is used to perform a regular expression. In this case no replacing is done, only a simple find. Copy the code below to give it a try.


// Example string
$str = "Let's find the stuff in between these two previous brackets";

// Let's perform the regex
$do = preg_match("/(.*)<\/bla>/", $str, $matches);

// Check if regex was successful
if ($do = true) {
// Matched something, show the matched string
echo htmlentities($matches['0']);

// Also how the text in between the tags
echo '
' . $matches['1'];
} else {
// No Match
echo "Couldn't find a match";
}

?>

After having run the code, it's probably a good idea if I do a quick run through the code. Basically, the whole core of the above code is the line that contains the preg_match. The first argument is your regex pattern. This is probably the most important. Later on in this tutorial, I will explain some basic regular expressions, but if you really want to learn regular expression then it's best if you look on Google for specific regular expression examples.

The second argument is the subject string. I assume that needs no explaining. Finally, the third argument can be optional, but if you want to get the matched text, or the text in between something, it's a good idea to use it (just like I used it in the example).

The preg_match function stops after it has found the first match. If you want to find ALL matches in a string, you need to use the preg_match_all function (http://www.php.net/preg_match_all). That works pretty much the same, so there is no need to separately explain it.

Now that we've had finding, let's do a find-and-replace, with the preg_replace function (http://www.php.net/preg_replace). The preg_replace function works pretty similar to the preg_match function, but instead there is another argument for the replacement string. Copy the code below, and run it.


// Example string
$str = "Let's replace the stuff between the bla brackets";

// Do the preg replace
$result = preg_replace ("/(.*)<\/bla>/", "new stuff", $str);

echo htmlentities($result);
?>

The result would then be the same string, except it would now say 'new stuff' between the bla tags. This is of course just a simple example, and more advanced replacements can be done.

You can also use keys in the replacement string. Say you still want the text between the brackets, and just add something? You use the $1, $2, etc keys for those. For example:


// Example string
$str = "Let's replace the stuff between the bla brackets";

// Do the preg replace
$result = preg_replace ("/(.*)<\/bla>/", "new stuff (the old: $1)", $str);

echo htmlentities($result);
?>

This would then print "Let's replace the new stuff (the old: stuff between) the bla brackets". $2 is for the second "catch-all", $3 for the third, etc.

That's about it for regular expressions. It seems very difficult, but once you grasp it is extremely easy yet one of the most powerful tools when programming in PHP. I can't count the number of times regex has saved me from hours of coding difficult text functions.

An Example

What would a good tutorial be without some real examples? Let's first have a look at a simple e-mail validation function. An e-mail address must start with letters or numbers, then have a @, then a domain, ending with an extension. The regex for that would be something like this: ^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$

Let me quickly explain that regex. Basically, the first part says that it must all be letters or numbers. Then we get the @, and after that there should be letters and/or numbers again (the domain). Finally we check for a period, and then for an extension. The code to use this regex looks like this:


// Good e-mail
$good = "john@example.com";

// Bad e-mail
$bad = "blabla@blabla";

// Let's check the good e-mail
if (preg_match("/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/", $good)) {
echo "Valid e-mail";
} else {
echo "Invalid e-mail";
}

echo '
';

// And check the bad e-mail
if (preg_match("/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/", $bad)) {
echo "Valid e-mail";
} else {
echo "Invalid e-mail";
}

?>

The result of this would be "Valid E-mail. Invalid E-mail", of course. We have just checked if an e-mail address is valid. If you wrap the above code in a function, you've got yourself a e-mail validation function. Keep in mind though that the regex isn't perfect: after all, it doesn't check whether the extension is too long, does it? Because I want to keep this tutorial short, I won't give the full fledged regex, but you can find it easily via Google.

Another Example

Another great example would be a telephone number. Say you want to verify telephone numbers and make sure they were in the correct format. Let's assume you want the numbers to be in the format of xxx-xxxxxxx. The code would look something like this:


// Good number
$good = "123-4567890";

// Bad number
$bad = "45-3423423";

// Let's check the good number
if (preg_match("/\d{3}-\d{7}/", $good)) {
echo "Valid number";
} else {
echo "Invalid number";
}

echo '
';

// And check the bad number
if (preg_match("/\d{3}-\d{7}/", $bad)) {
echo "Valid number";
} else {
echo "Invalid number";
}

?>

The regex is fairly simple, because we use \d. This basically means "match any digit" with the length behind it. In this example it first looks for 3 digits, then a '-' (hyphen) and finally 7 digits. Works perfectly, and does exactly what we want.

What exactly is possible with Regular Expressions?

Regular expressions are actually one of the most powerful tools in PHP, or any other language for that matter (you can use it in your mod_rewrite rules as well!). There is so much you can do with regex, and we've only scratched the surface in this tutorial with some very basic examples.

If you really want to dig into regex I suggest you search on Google for more tutorials, and try to learn the regex syntax. It isn't easy, and there's quite a steep learning curve (in my opinion), but the best way to learn is to go through a lot of examples, and try to translate them in plain English. It really helps you learn the syntax.

In the future I will dedicate a complete article to strictly examples, including more advanced ones, without any explanation. But for now, I can only give you links to other tutorials:

The 30 Minute Regex Tutorial (http://www.codeproject.com/dotnet/RegexTutorial.asp)

Regular-Expressions.info (http://www.regular-expressions.info/)

:: +/- :: Read more...

Design Web Album and Deployment Using Adobe and Macromedia

by: Robert Kennedy


OK, here is my mission; completely install a customer example photo gallery found here http://www.cardprinting.net/ in 2 hours or less. The basic process starts from Adobe Illustrator CS or Corel Draw 12. This is the format all customers’ work is saved in. There are aproximately. 300 files I need to access export and create a photo album with full navigation.

Here's how I did it. Instead of opening each file in its native program I tried opening CDR and AI files in Adobe Photoshop. Guess what? It works with the ai files but not the cdr files. Why is this important? Because 90% of my files are in ai format! Illustrator only allows you to open 1 file at a time, Photoshop allows you to open as many as your computer's resources can handle. At the same time Photoshop converts each vector based image to a bitmap, which is required for the web. Now, you could create a course of 'actions' to complete this more efficiently, but I want to remove or retouch some undesirable from each image. I am a 'perfectionist' so I want these images looken good AND loading fast for the web. Personally I find Adobe Photoshop and Macromedia Fireworks offer the best export filters for the web.

So now I have 300 images looken good, properly cropped and optimized for the web. What is the best way to create a Photo Album from so many images? Again let's refer to my favorites for this, Macro Media or Adobe? I work with both for different projects and really can't pick a favorite here! They are both excellent for this. Macromedia Dreamweaver has a function found under commands>create photo album, shown here http://www.weprintcolors.com/screens/screen_dw_create_photo.htm. You will need Fireworks installed for this to work. Go ahead and fill in all the text fields that are required information shown here http://www.weprintcolors.com/screens/screen_dw_create_photo_menu.htm. It is important you take the time to craft your words carefully, especially in the first field as this text is written into every html file generated. Check the appropriate format, rows and columns etc. Check the box for file names on or off and check the box for, 'create navigation page for each photo'. OK that's it you're ready to fire away, click OK. Amazing, eh?

Well I am kind of busy right now working on my next project. In my next post I will talk about the same process of creating a web based photo album using adobe photo shop for the entire process.

:: +/- :: Read more...

Get Money on Internet

Get Paypal Account, click link below :

Sign up for PayPal and start accepting credit card payments instantly.


Get AlertPay Account, click link below :




Earn Money with your Files, click link below :

Make Money from your Website or Blog, click link below :

Promote your Site set:

Get Free Domain, click link below:

Free Domain

Earn Cash Within Minutes! It's Free to Join!


Join Vinefire!





Get Free Webhosting :

Free Website Hosting

Free cPanel Web Hosting with PHP5/Mysql - no advertising!
Register now: Join

Twitter Advertising



The Real PTC Payout












Pay4Surf - Paying Manual Traffic Exchange!














The adf referral program is a great way to spread the word of this great service and to earn even more money with your short links, or here :Linkbee

Earn even more money with your short links, Click here :



Join short links

Adsense from Indonesia :

Adsense Indonesia

Web Hosting & Domain : Reg. Here





The best internet investment, Earn a XXX% daily profit! Easy. Safe. No risk.