homepage Welcome to WebmasterWorld Guest from 54.161.214.221
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP and Metatags
How Should I go about this?
Jeigh




msg:3386670
 6:38 am on Jul 5, 2007 (gmt 0)

Hello,

For my site I include header.php on every page which as the meta tag in it, which of course makes it hard for me to change the meta tag for every page, So I have some questions:

1. Are they really necessary these days?
2. What would be the best way to get different meta tags on each page.
3. Will my PR get punished for having the same keywords on every page in the meta tags?

In regards to question 2, the only thing I've been able to think of currently is using a database for extracting the meta tags but I'm pretty sure that wont work how I have my site set up now since I'm mainly just using different PHP files.

Finally, I have a section where people make profiles, and they're profile link would be /profile.php?user=username, so if I make another column called keywords I could just use $req_user_info['keywords'] within the meta tag for those pages?

Thanks for any help :)

 

Habtom




msg:3386680
 7:06 am on Jul 5, 2007 (gmt 0)

Your questions related to your meta tags, I think you need to post them at the relevant forum.

Regarding this:
For my site I include header.php on every page which as the meta tag in it, which of course makes it hard for me to change the meta tag for every page

There are a number of ways you can keep it simple. Your specific file structure could be different, but you can do the following.

You mentioned you have a number of dynamic files. When you include the header, you can pass a value, in which case inside your header.php, you can either query the meta tags from the database, or from an array where you can read the info from.

If you provide more details, will get back to you with a response.

Habtom

netchicken1




msg:3386685
 7:34 am on Jul 5, 2007 (gmt 0)

I generate description metatags from the title of the post. Keyword metatags come from the first 250 charactors in the post.

All dynamically generated with php.

If you write your thread with the tags in mind it works well.

Habtom




msg:3386689
 7:54 am on Jul 5, 2007 (gmt 0)

I generate description metatags from the title of the post. Keyword metatags come from the first 250 charactors in the post.

I think a bit of less control, but less headace and time wasted generating keywords.

I like the idea.

jatar_k




msg:3386881
 1:16 pm on Jul 5, 2007 (gmt 0)

as far as meta tags look at this one
[webmasterworld.com...]

natural number




msg:3389229
 4:33 am on Jul 9, 2007 (gmt 0)

I think meta-tags are important.

You can easily put meta-tags on each page, and then revise your header.inc.php file to just have the html content of the header only.

So you'd would have code like this

<META TAGS>
include('header.inc.php');

Of course, you could always write your header file to generate meta-tags for you also.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved