Give Your Friends Credit
This was inspired by Robert Plank's Black Hat PHP ebook.
So you know, I am working on increasing my online exposure. Part of the way I am doing that is giving away some of my stuff - show you what I can do. If you have been a regular reader of this site, you know that I am creating a database driven affiliate web site that I am going to give away (how to you get a free site, you ask? Use the signup form and get on my mailing list).
Additionally, I have recently added a feature that gives you the possibility of making money from this site.
If you refer people to this site and they either signup or purchase one of my products that I sell on Clickbank - you can get credit using a special link to direct visitors here.

Send people to this site using the following link: http://www.davewooding.com/visit/cb_aff
Replace the cb_aff with your ClickBank affiliate id (IMPORTANT: do NOT put a trailing slash (/) at the end or it won't work)
Your affiliate link will show up in the autoresponder:

Any emails I sent out for a product of mine will have your affiliate id embedded.
Also any product that I sell off of this page via Clickbank (yes, there is a product for sale):

If you are familiar with looking at the html code, go look at it now - see if the html code looks similar to what I just showed you. If not, type in this link in your brower's address bar, http://www.davewooding.com/visit/cb_aff (replace the cb_aff with your affiliate id).
So there, I have come clean with my intentions - I'm looking to increase my online exposure and am willing to pay for it!
Unique Datafeed Content
There's a problem with datafeed affiliate sites - at least it is a problem if you want your sites to stand out from all of the competition - duplicate content.
Who do you think will rank higher in the search engines for specific terms that you might find in your datafeed? Probably the merchant. If this happens, then your site is less likely to get the click that gets the affiliate sale.
So what to do, what to do - let me think. Hmm.
Let's get a little creative with what the merchant gives us, shall we.
Here's an example entry that we can use from the affiliate's datafeed.

I was planning on using the second line, the one that says "American Beech" as the title. What is to stop me from also adding the word "Tree" found on the 12th line down to the title. Nothing really. I can make the affiliate script combine portions of the datafeed and mash it up to create a new title. Pretty cool, huh!
Or how about this idea.
Instead of using the "Dahlia - Dinnerplate - Magic Sunrise" as the title, why not (1) get rid of the dash (-) and also rearrange the words to read "Magic Sunrise Dahlia Dinnerplate"? I can already see the PHP code to do that.

Want in on a big secret - on how I am going to make each site affiliate datafeed site that I create unique?
What secret little piece of PHP code that I have planned for making certain that no matter what, each site I build is not identical to any other site.
Ready? Here it is ... modulus.
I'll explain later :)
Random Text
Brian asked the following question in a reply to the random image post I made.
How do you do the same for random snippets, or lines of text that you have in one txt file?
I thought it was a very good question considering that I am working on a database driven affiliate website - the ability to pull in random info is useful, in particular if I am interested in having "unique" content - and I am interested.
So I thought I would share how to pull in random snippets for everyone to see.
For this to work, we need to make a few assumptions.
In this example, you will need to have a text file with your snippets in the same directory that that you want to display the snippets in.
The file should be readable (most are by default).
And finally, each snippet is a separate line (which means that a carriage return was typed at the end of each snippet) - the importance of this is shown further down the page ..
Contents of your text file should look like something like this:
This is the first sentence.
The second sentence is here.
Read the third sentence.
Now we want the php script to (1) open the file and (2) read in the contents.
Here's what that looks like:
<?php
$file = "file.txt";
$fh = fopen($file, 'r');
$content = fread($fh, filesize($file));
?>
Next step is to dump the results into an array.
<?php
$contents = explode("\n", trim($content));
?>
For those interested, this little line of code says to clean up the info from the variable $content (trim), break the information into pieces every time a carriage return shows up (explode and \n), and put the pieces into an array called $contents.
Now, just print out a random selection (array_rand) from that newly created array.
<?php
print $contents[array_rand($contents)];
?>
Magic!
Here's what the final script looks like.
<?php
$file = "file.txt";
$fh = fopen($file, 'r');
$content = fread($fh, filesize($file));
$contents = explode("\n", trim($content));
print $contents[array_rand($contents)];
?>
This is something you can insert in your php pages (or php enabled html pages) to display random snippets of text. Like I said, stuff like this is what you can use to make the content of your web pages unique - especially if your are using similar content to others, like database driven affiliate sites.
Crawl Rate Tracker
Taking a break from building a database driven affiliate site to let you know about a cool little plugin. Patrick Altoft from Blogstorm just release the crawl rate tracker.
![]()
Yeah, yeah, I know - no visits. I just installed it, give it a minute.
This has techo-geek written all over it. You can install this little plugin and track which of the Big3 Search Engines are visiting your site. Try it out.
Setting Up An Affiliate Database Driven Website
So you can make money - automatically.
You can have a "hands free" database driven affiliate site up and running by following these instructions.
The first datafeed video (the one you watched at the top of this page) gets a datafeed on your site ready for use.
- FTP zip datafeed to your web server
- Unzip the file on your server
Simple.
Now we get ready to dump the datafeed into a MySQL database.
First things first. Need to setup a MySQL database - that means having a database name, a username, and password.
This database setup video shows you exactly what to do.
- Create a MySQL database
- Create a user and password
- Assign the user to the database
Keep Your Site Running Smooth
To make life a little easier, you will want to create a config file that contains the database, username, and password. This file, which we will name config.php, will be used to retrieve and store information.
Config file should look something like this.
<?
$mysql_database = "account_databasename";
$mysql_user = "account_databaseuser";
$mysql_password = "password";
$dbh=mysql_connect ("localhost", $mysql_user, $mysql_password ) or die (mysql_error());
mysql_select_db ($mysql_database);
?>
Once complete, the config file gets uploaded to your server.
Random Images
I said I would do some work on the foundation of this weblog.
See the sidebar over there, the one with my lovely mugshot? Yeah, that one. I hardcoded some of the info in there, in particular the section that includes my picture.
If you were to hit the refresh button, another picture would show up. Magic, huh?
Not really, but it did use a little PHP to get that impact.
Here's what I did.
1) Login to the admin section.
2) Click on Presentation.
3) Click on Theme Editor, then for this theme, I clicked on sidebar.php.
Here's where the PHP magic occurs.

That image might be a little tough to see, here's the important part.
<img src="http://www.davewooding.com/images/<? echo rand(1,6); ?>.jpg">
Note the php echo statement in there. Before I explain, I should tell you that I created 6 images to use for this and labeled them 1.jpg, 2.jpg, 3.jpg, 4.jpg, 5.jpg and ... drumroll, please ... 6.jpg.
That php echo statement in there with the rand function says to pick a random number (1 thorugh 6) and print that out. Notice that it prints out in the middle of an image source statement - that's how I get a random picture to show up.
Let’s Get This Blog Started
"And in the beginning" ... what a great opening line.
Time to start building a brand for myself. Get out and press the flesh with the people. Shake some hands, get pictures taken with the babies, break ground on the new skyscraper. Oh, sorry, wrong conversation.
Where was I? Oh, yes, talking with you. Letting you know what's going on around here. Telling you my great plans for this little old weblog out on the internut.
I guess I should start with what I have planned for this site. After I spruce up the interior a little - a new paint job, refinish the floors, new kitchen cabinets ... no, no, no, no - there I go again, getting off track.
Actually, I do mean I need to spruce up the interior of this weblog a bit. Give it a solid foundation to build on. Stuff like tricking out the title - get rid of that damn raquo thing, you know that 'greater than symbol' that services no worthwhile purpose. I have the latest and greatest version of Wordpress running this site. Not sure what all of its capabilities are, noticed a bunch of widgets running around when I went to muck around with the presentation. I'll have to wrap my head around widgets and I see if I like what I have here. Or maybe just do it the old fashion way and edit using vi on the command line. Something like this.

Dont' worry, I won't make you touch it, it doesn't hurt.
Once I have the look and feel stuff done, will move on to adding analytics - maybe Statcounter or Google Analytics for tracking.
Of course, I'll make the effort to build a list of subscribers - plan on making it worthwhile by giving stuff away. When I say stuff, I mean useful PHP scripts - kind of like what Robert Plank does at his site.
Then I'm going on a bender and getting setup with a bunch of Web 2.0 stuff for promoting this bad boy blog. De.licio.us, onlywire, propeller, youtube, slideshare - whatever else I can think of to toot my own horn.
I have thought about linkbaiting. Already have in mind who I'm targeting - going for the big fish on this one. Title will read something like "_____ ____, I have your wife hostage." The ironic thing is I have something to back it up with - something I bought November 2007 when I first found out about this little factoid. Cloak and dagger stuff - ohhh, ahhhh, exiting!
And to finish up, I'm going to click on those links I just dropped and see if I can attract any attention over here.
There you go, the first blog post.






