By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,374 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,374 IT Pros & Developers. It's quick & easy.

PHP and keywords

P: n/a
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

Jul 17 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
John Chiurato wrote:
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


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
Jul 17 '05 #2

P: n/a
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.

Jul 17 '05 #3

P: n/a
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
Jul 17 '05 #4

P: n/a
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
Jul 17 '05 #5

P: n/a
John Dunlop wrote:
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


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
Jul 17 '05 #6

P: n/a
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"
<si******************************************@spam yourself.com> wrote in
message news:41**********************@news.xs4all.nl... John Chiurato wrote:
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
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

Jul 17 '05 #7

P: n/a
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


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"
<si******************************************@spam yourself.com> wrote in
message news:41**********************@news.xs4all.nl...
John Chiurato wrote:
> 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


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


Jul 17 '05 #8

P: n/a
cl*****@gmail.com 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. Regarding
this you should take a look on the mod_rewrite facilities.

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=valu...=anothervalue).
--
Scott Orsburn
scottso_no@spam_maclaunch.com

Kaomso | Information Technology
www.kaomso.com

Jul 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.