Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Keywords specific to query string

Status
Not open for further replies.

gmail2

Programmer
Jun 15, 2005
987
IE
I'm currently creating a website for a publishing company. I have a page authors.php where I pass a query string (eg authors.php?5 which will obviously pull up info for author with authorID number 5). I've created a table in my db called keywords and my plan is to dynamically put in the keywords based on the author ID. What I want to know is will search engines be able to pick these up seing that the keywords aren't hard coded into the file? This is assuming that I've added each URL into the robots.txt file.

Thanks in advance for any help anybody can provide
 
added each URL into the robots.txt file"? The last time I checked, robots.txt tells search engine spiders where not to look. Do you want the spiders to search your site?


Spiders do not generate input to plug into a page. Well, legitimate ones do not. So without links somewhere with each possible author ID value, spiders are not going to suck down your site.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
>> The last time I checked, robots.txt tells search engine spiders where not to look

Really, oh right. Must have misunderstood that bit then !!

>> Spiders do not generate input to plug into a page

Don't quiet understand what you mean exactly here

>> So without links somewhere with each possible author ID value, spiders are not going to suck down your site.

That makes sense, should have though of that. Yes there will be links to the page with each of the author ID's so I guess that solve my problem - yes?
 
Having links to all authors gets you closer.

But I am confused about what you are going to do with the keywords you talked about in your original post.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
OK So I have a file called say author_list.php - this will loop through the autors table in the db and print a link like so:
<a href="author.php?autorID=1">Author 1</a>
<a href="author.php?autorID=2">Author 2</a>
...
etc
...

Now then, in the author.php file I will have something like this (don't know if you're familiar with PHP but hopefully you'll get the idea):

<html>
<head>
<?php
$authorID = $_GET['authorID']; // gets the author ID from the URL and assignes it to that variable
$get_keywords = mysql_query("SELECT * FROM keywords WHERE authorID = '$authorID'"); // get all the keywords from the db
echo "<meta name=\"keywords\" content=\"";
while($keywords = mysql_fetch_array($get_keywords))
{
echo "$keywords['keyword'].",";
}
echo "\" />

The code needs to be tiedied up a bit but basically what I want to do is:
1. Create a link for each author
2. Generate a personal page for that author
3. In the head, pull keywords specific to that author and put them in the meta tag

Will search engines still pick these up? I presume they will as they're not going to get to see the PHP are they because once it's gone through the http server the PHP gets converted to HTML. But just wanted to double check. Hope this doesn't sound confusing !?!?!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top