Unlimited Pages For Your Portal

By: John Elder posted in Affiliate Portals


Hello good people!

Well it looks like it’s going to be an insanely beautiful day here in downtown Chicago. We’re looking at the mid 80’s with lot’s of sun. Great way to start off the weekend!

Sorry it’s taken me a week to post again, but I was invaded by family coming to visit and have been running myself ragged playing tour guide all week.

Today I want to talk about something that’s incredibly important when building an affiliate or advertising driven website (not just a shopping portal website).

Dynamic Pages

The secret to getting lots of search engine traffic is having lots of pages. The more pages you have to crawl, the more chances you have to get those pages indexed for longtail keywords.

The problem is that creating content and pages by hand is time consuming and expensive. The trick is to dynamically generate pages on the fly, infinitely.

I do that programatically using php and a little .htaccess rewrite trick that I’m going to show you shortly.

First Things First

The first thing we need to do is go back and change our first page form submission box. When you submit data via a web form, there’s two methods to use, either POST or GET.

Last week when I wrote it, I used POST. Post is good because it keeps the form data hidden when passing it to the server. But now I need to change it to GET. Why? Because I don’t want the data to remain hidden. I want it to show up in the URL the comes up after you click the search button.

Confused? Yeah, I didn’t explain that well. Think of it like this: last week if you went to whythere.com and typed in hammers, the page that came up was called:

www.whythere.com/search.php

After changing the form method to GET, the resulting page will look something like this:

www.whythere.com/search.php?search=hammers

To make this change, we just have to change this line in our index.php file from:

<form method="POST action="search.php">
<input type="text" name="search" size="75" class="searchbox" maxlength="600"><br><br>
<input type="submit" name="submit" value="Search For Lowest Prices">
</form>

to…

<form method="GET" action="search.php">
<input type="text" name="search" size="75" class="searchbox" maxlength="600"><br><br>
<input type="submit" name="submit" value="Search For Lowest Prices">
</form>

We also have to change this line in our search.php file from:

<?php
$search = trim($_POST['search']);
?>

to…

<?php
$search = trim($_GET['search']);
?>

So let’s look at the significance of this little change. Now we can dynamically create a list of pages on our site, just by creating a list of links using this general format.

www.whythere.com/search.php?search=ENTERKEYORDHERE

notice the ENTERKEYWORDHERE part of that URL. Basically we can put any keyword there and we’ll have a page about that keyword. Try it out:

  • www.whythere.com/search.php?search=hammers
  • www.whythere.com/search.php?search=vacuums
  • www.whythere.com/search.php?search=drills
  • www.whythere.com/search.php?search=beach+balls
  • www.whythere.com/search.php?search=bulls+hats

Notice when we want to use a keyword with a space in it like beach balls, we just use the + sign where the space would be.

OK, but that looks ugly!

You’re right…that’s an ugly URL and the search engines will definitely realize we’re just feeding it dynamically generated trash. We need to disguise the URLs and make them look better.

Instead of :
www.whythere.com/search.php?search=hammers

We’d much rather have something that looks like this:

www.whythere.com/hammers.html

It’s easily accomplished with a quick tinker to your web server’s .htaccess file and a quick change to the search.php file…but I’ll get into that next time.

Until then…Keep on building!

-John
The Marketing Fool!

John Elder is an Entrepreneur, Web Developer, and Writer with over 27 years experience creating & running some of the most interesting websites on the Internet. Contact him here.



Did you like this article? Share it:


No comments.

Leave a Reply