Worried that using PHP may affect my search engine ranking. Would a script
like the one below be adequate?
<?php
class Page {
var $Title;
var $Keywords;
var $Content;
}
?>
Thanks
Hi John,
What is it excactly you want to accomplish?
You example creates a useless class, and produces no output.
So no searchengine cares about it. They cannot see it!
In general: PHP just produces HTML (or pictures, or whatever) as far as the
client is concerned.
If the client is a webbrowser that webbrowser just displays the output (HTML
probably) produced by PHP.
The fact that the server is executing PHP to produce the HTML is of no
concern to the client.
If the client is a searchengine: the same output (HMTL) is produced, and
again the searchengine couldn't care less.
But if you have a few popular pages in plain HTML, and want to change them
to php, changes are that the searchengine will have to reindex them because
the page has a different name. (blabla.php instead of blabla.html)
Regards,
Erwin Moller
> Also, it should be noted that the search engines will hardly index
> pages like page.php?action=view&id=100&whatever=yes&so_on=1.
I don't see why they wouldn't, but if you're implying that
that address looks awful, I agree.
--
Jock
> But if you have a few popular pages in plain HTML, and want to change them
> to php, chances are that the searchengine will have to reindex them because
> the page has a different name. (blabla.php instead of blabla.html)
Only if the published address of the resource wasn't given
enough thought in the first place. Publishers of well-
thought-out URIs do not suffer that disruption. Changing
addresses is an inconvenience not only to the publisher, but
to the public too.
http://www.w3.org/Provider/Style/URI
--
Jock
Hi John,
Interesting piece. I read it with pleasure.
Of course the problem is that many softwareprojects must be delivered for a
certain amount of money.
I think this URI-consistency (or how to call it?) is often one of the things
very low on the list. :-(
But I completely agree with you: if thought through well beforehand,
many/all these problems (dead links) can be avoided.
Thanks.
Regards,
Erwin Moller
> If the client is a search engine: the same output (HMTL) is produced, and
again the search engine couldn't care less.
So if I were to write the correct PHP (God help me), the spider would se it
as viable HTML and keywords, correct?
Together with mysql, PHP is some pretty impressive stuff.
Thanks for taking the time to answer my question. I'll be lurking around
here to learn more.
"Erwin Moller"
<since_humans_read_this...@spamyourself.com> wrote in
message news:41e2595f$0$6208$e4fe...@news.xs4all.nl...
Hi John,
> What I am trying to accomplish is a script of viable keywords for each
> page drawn from a mysql database so proper ranking and relevancy can be
> established. So you say
>
>> If the client is a search engine: the same output (HMTL) is produced, and
> again the search engine couldn't care less.
>
> So if I were to write the correct PHP (God help me), the spider would se
> it as viable HTML and keywords, correct?
correct!
When you write something like:
(This is a Postgresql-code, not mySQL)
And this is a fantasy-example.
(Also I wrote the code not very compact to show you what happens)
suppose you have a table called:
tblKeywords
(
keywordid SERIAL (=autonumber) PRIMARY KEY,
pageid int REFERENCES tblpage(pageid),
keyword text
)
where pageid points to some tblpage, ok?
<?
$SQL_keywords = "SELECT keyword FROM tblKeywords WHERE (pageid=45)";
$RS_keywords = pg_exec($connection,$SQL_keywords);
$numrows_keywords = pg_numrows($RS_keywords);
$myKeywords = array();
for ($i=0;$qi<$numrows_keywords;$i++)
{
$row_keywords = pg_fetch_array($RS_keywords,$i,PGSQL_ASSOC);
$myKeywords[] = $row_keywords["keyword"];
}
$keywordsstring = implode("," , $myKeywords);
// untill now we haven't produced ANY output.
// SO untill here no visitor (searchengine or otherwise) sees what we did.
// So, now output it for real:
echo "<meta name='keywords' content = '". $keywordsstring ."'>"
?>
Good luck!
I didn't test the code, but this is how to do it.
Please visit:
http://www.php.net
to find all the functions I used (like implode)
http://www.w3schools.com/SQL
to learn more about SQL. (if needed)
http://www.website101.com/HTML/metatags_seo.html
to learn a bit about metatags.
Enjoy, PHP is a good choice, you will enjoy it!
Regards,
Erwin Moller
I'm not prepared to state that search engines will index URLs with long
query strings, but the major web crawlers will in fact index URLs with
query strings (a la:
http://domain/file.php?variable=value&variable2=anothervalue).
--
Scott Orsburn
scottso_no@spam_maclaunch.com
Kaomso | Information Technology
www.kaomso.com