Jump to content

SEO Friendly Page Titles


aweb

Recommended Posts

I am having trouble figuring out the best way to fix my site page titles so that they are more search engine friendly.

 

Currently, I have a categories.php files from which about 30 different categories are generated from. The url structure of this looks like: http://www.mysite.com/categories.php?id=15. I would like it to instead grab the category name from the database and put it in place of "categories.php?id=#".

 

The category is defined at the beginning of the category.php and the connection.php and header.php are included. Also at the top of the page is the following code that defines the site title and the the category list that is echoed later in the document.

 

$servcat=mysql_query("select * from We_ServiceCategory_tbl ");
               if(mysql_num_rows($servcat)>0)
               {
                  $CatList = "";
                  while($rscat=mysql_fetch_assoc($servcat))
                  {
                     if($rscat['Category_Id'] == $_REQUEST['id']) $title = htmlentities($rscat['Category_text']);
                    $CatList .= "<a href=\"categories.php?id=".$rscat['Category_Id']."\">".htmlentities($rscat['Category_text'])."</a>";

 

If anything I just want to be able to replace "categories.php?id=#" with

htmlentities($rscat['Category_text'])

 

Any help would be great.

Link to comment
https://forums.phpfreaks.com/topic/179920-seo-friendly-page-titles/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.