Forum Moderators: coopster

Message Too Old, No Replies

PHP <meta><head>.etc.

         

tonynoriega

1:57 am on Jan 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK...sorry if this is dumb as could be...but remember...im converting over from ASP....sorry....

How can i create META tags, HEAD tags...etc...that will help with SEO when i have a PHP page...?

i tried to echo, and maybe i did it wrong, but i cant figure it out....reason is, i want to put a TITLE, and a DESCRIPTION tag on my introduction page wich now, is pure PHP...

any pointers are greatly appreciated....
(..hint ..hint CAMERAMAN, JAG...)

tonynoriega

2:28 am on Jan 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



which brings another question...

are meta tags crawlable, by SE spiders in PHP?

cameraman

2:57 am on Jan 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have mine set up like this:

<title><?php echo $ts;?></title>
<META NAME="description" CONTENT="<?php echo $ds;?>" />

and then I just supply the content in the variables. You shouldn't have any trouble doing the whole thing as an echo, though:
echo "<META NAME=\"description\" CONTENT=\"Great source for examples\" />\n";

I know the spiders crawl them for the description; it shows up under the title in search results.

tonynoriega

5:24 am on Jan 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i tried mine like this versus yours:

me: echo "<META NAME='desctiption' CONTENT='blah blah...'>;

you: echo "<META NAME=\"description\" CONTENT=\"Great source for examples\" />\n";

can you tell me why mine would be wrong...becuase i know it is...

thanks

cameraman

5:31 am on Jan 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you pasted those in, then description is misspelled and you don't have a closing quote just before the semicolon.

I've always done HTML parameters with double quotes but as far as I know single quotes aren't "wrong". So if you just typo'd yours into the post and the above two problems aren't actually there in the page, I don't see anything wrong with yours.

tonynoriega

3:21 pm on Jan 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah, just rusing to type....kids screaming at my heels....

ok, so double versus single, should not cause an issue...

thanks