Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PHP and keywords

0 views
Skip to first unread message

John Chiurato

unread,
Jan 9, 2005, 11:08:55 PM1/9/05
to
Yes, I am a newbie to PHP.

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

Erwin Moller

unread,
Jan 10, 2005, 5:30:55 AM1/10/05
to
John Chiurato wrote:

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

cla...@gmail.com

unread,
Jan 10, 2005, 6:41:59 AM1/10/05
to
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. Regarding
this you should take a look on the mod_rewrite facilities.

John Dunlop

unread,
Jan 11, 2005, 6:10:25 AM1/11/05
to
An anonymous being wrote:

> 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

John Dunlop

unread,
Jan 11, 2005, 6:10:24 AM1/11/05
to
Erwin Moller wrote:

> 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

Erwin Moller

unread,
Jan 11, 2005, 7:05:57 AM1/11/05
to
John Dunlop wrote:

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

John Chiurato

unread,
Jan 13, 2005, 12:16:38 AM1/13/05
to
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?

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...

Erwin Moller

unread,
Jan 13, 2005, 4:57:04 AM1/13/05
to
John Chiurato wrote:

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

Scott Orsburn

unread,
Jan 24, 2005, 1:53:49 PM1/24/05
to
cla...@gmail.com wrote:


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

0 new messages