John Chiurato wrote:
Hi John,
[color=blue]
> 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
>[color=green]
>> If the client is a search engine: the same output (HMTL) is produced, and[/color]
> 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?[/color]
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
[color=blue]
>
> 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_I_am_spammed_too_much@spam yourself.com> wrote in
> message news:41e2595f$0$6208$e4fe514c@news.xs4all.nl...[color=green]
>> John Chiurato wrote:
>>[color=darkred]
>> > Yes, I am a newbie to PHP.
>> >
>> > Worried that using PHP may affect my search engine ranking. Would a[/color][/color]
> script[color=green][color=darkred]
>> > like the one below be adequate?
>> >
>> > <?php
>> > class Page {
>> > var $Title;
>> > var $Keywords;
>> > var $Content;
>> > }
>> > ?>
>> >
>> > Thanks[/color]
>>
>> 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[/color]
> the[color=green]
>> client is concerned.
>> If the client is a webbrowser that webbrowser just displays the output[/color]
> (HTML[color=green]
>> 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[/color]
> because[color=green]
>> the page has a different name. (blabla.php instead of blabla.html)
>>
>>
>> Regards,
>> Erwin Moller[/color][/color]