iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2008, 01:28 PM
Moderator
WebProWorld Moderator
 
Join Date: Oct 2003
Location: Alberta, Canada
Posts: 878
weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6
Default Duplicate meta descriptions

PHP Code:
<title>Instructors :: <?php echo $cwIns ?></title>
<meta content="Independent Instructor,  <?php echo $cwIns ?>" name="description" />
<meta content="lifelong learning,adult literacy,instructor,<?php echo $cwIns ?>" name="keywords" />
Every generated page should have a unique title, description and keywords, right? The responded pages are unique, as expected. So why does GWT flag them as having duplicate descriptions?

Should the code look more like this?
PHP Code:
<?php 
 $str 
"<title>Instructors :: " $cwIns "</title>\n";
 
$str .= "<meta content=\"Independent Instructor, " $cwIns "\" name=\"description\" />\n";
 
$str .= "<meta content=\"lifelong learning,adult literacy,instructor," $cwIns "\" name=\"keywords\" />\n";
 echo 
$str;
 
?>
Reply With Quote
  #2 (permalink)  
Old 12-22-2008, 06:22 AM
WebProWorld Member
 
Join Date: Aug 2008
Posts: 66
maneetpuri RepRank 0
Default Re: Duplicate meta descriptions

Hi,

GWT should not do that, but if its happening then you need to tell how your are generating the variable $cwIns?

Also open these pages in different browser windows and view the source and see if all the pages have different meta description or not.

Cheers,

__________________
Web Design Services \ Data Mining Services
"Our Vision, Your Expansion"
Reply With Quote
  #3 (permalink)  
Old 12-23-2008, 01:57 AM
Moderator
WebProWorld Moderator
 
Join Date: Oct 2003
Location: Alberta, Canada
Posts: 878
weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6
Default Re: Duplicate meta descriptions

Quote:
Originally Posted by maneetpuri View Post
... tell how you are generating the variable $cwIns?
Herein must lay the crux. Good catch!

The pages are generating as per schedule in all current version browsers, XP, including Safari. The user agents should be seeing the same generated page, shouldn't they?

An index page is the trap for this url, and from a lookup table supplies related data to the page. The variable value is contained in the query string and is not altered during initial processing. Since the pages are all happening per spec, there is no obvious slip up in the code that is making itself evident at this point.

Whats more, the pages are being indexed so the user agents must be seeing them. The descriptions and keywords HAVE to be different. I can't get them to be the same by any trick or fancy. And since the actual pages are making it into the index, I know it's not the fall back page being repeated for each URL.

Last edited by weegillis; 12-23-2008 at 01:59 AM.
Reply With Quote
  #4 (permalink)  
Old 12-23-2008, 06:22 AM
WebProWorld Member
 
Join Date: Aug 2008
Posts: 66
maneetpuri RepRank 0
Default Re: Duplicate meta descriptions

Hi,

I think you will have to do some manipulation at the stage where the variable is being created. The manipulation will be to generate different values for the descriptions.

If you can share with me the code generating this variable and give some input on how you want the description to be generated then i might comment on how this can be done.

Cheers,

~Maneet
__________________
Web Design Services \ Data Mining Services
"Our Vision, Your Expansion"
Reply With Quote
  #5 (permalink)  
Old 12-23-2008, 01:38 PM
Moderator
WebProWorld Moderator
 
Join Date: Oct 2003
Location: Alberta, Canada
Posts: 878
weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6
Default Re: Duplicate meta descriptions

The landing page is index.php. index.csv consists of n rows, 1 per instructor. The first three columns are index number, instructor id and their name, following are groups of 4 columns, one group for each course taught. %1 is course id, %2 is course name, %3 is course objective index number (1..4), %4 is a status flag (0 || 1).

Each URL is double-keyed. Either an index number match, or an instructor id match will return true and route through index2.php. All others return false and fall back to index1.php, the default index page.

The main array, built as the validation lookup table remains global, while the unique variables that have been parsed out of the table are passed to index2.php, including $cwIns, all of which are declared global.


/instructors/

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<?php
$isMatch 
FALSE;
$pgId = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
if (
$pgId) {
 
$x "index.csv";
 
cwBuild($x);
 foreach (
$cwId as $key => $val) {
  if (
intval($pgId) - intval($key) == 0) {
   
$isMatch TRUE;
   
cwUnique($val);
   break;
  }
 }
 if (
$isMatch !== TRUE) {
  foreach (
$cwId as $key => $val) {
   foreach (
$val as $k => $v) {
    if (
$pgId == $k) {
     
$isMatch TRUE;
     
cwUnique($val);
     break 
2;
    }
   }
  }
 }
}
if (
$isMatch) {
 include_once 
"index2.php";
 } else {
 include_once 
"index1.php";
}
?>

</html>

<?php
function cwBuild($x) {
 global 
$cwId;
 
$cwId = array();
 
$handle fopen($x"r");
 while ((
$data fgetcsv($handle500",")) !== FALSE) {
  
$num count($data);
  
$cwVal = array();
  
$cwKey = array();
  
$cwData = array();
  for (
$c=0$c $num$c++) {  
   if (
$c == 0) {
    
$temp $data[$c];
   }
   if (
$c == 1) {
    
$tmp $data[$c];
   }
   if (
$c == 2) {
    
$tp $data[$c];
   }
   if (((
1+$c)%== 0) && ($c 0)) {
    
$t $data[$c];
    
$c1=$c+1;
    
$crsName=$data[$c1];
    
$c2=$c+2;
    
$crsObj=$data[$c2];
    
$c3=$c+3;
    
$status $data[$c3];
    
$cwVal[$t] = array($crsName,$crsObj,$status);
    
$c=$c+3;
   } 
  }
  
$cwData[$tp] = $cwVal;
  
$cwKey[$tmp] = $cwData;
  
$cwId[$temp] = $cwKey;
 }
 
fclose($handle);
}
function 
cwUnique($val) {
 global 
$cwInsId,$cwIns,$cwCrsLoad;
 
$cwCrsLoad = array();
 
$vw=array();
 foreach (
$val as $kw => $vw) {
  
$cwInsId $kw;
  
$vx=array();
  foreach (
$vw as $kx => $vx) {
   
$cwIns $kx;  
   
$cwCrsLoad $vx;
  }
 }
}
?>

Last edited by weegillis; 12-23-2008 at 01:41 PM.
Reply With Quote
  #6 (permalink)  
Old 12-23-2008, 02:20 PM
Moderator
WebProWorld Moderator
 
Join Date: Oct 2003
Location: Alberta, Canada
Posts: 878
weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6
Default Re: Duplicate meta descriptions

I just came from GWT where the site is given all green lights. It seems I may have answered my own question in the OP. The latter is the method employed as an experimental solution, and it seems to have worked.

It's a mystery why the UAs couldn't see what the browser was seeing in the former version. Looks like I'll be using the string method from now on.

Thank you, Maneetpuri, for the highly objective input. I'd love to take in any critical input you may have on the above code. Even while it may work, it is still the output of a PHP dabbler. I'm ripe for learning.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate Keywords Meta Tags staker2 Search Engine Optimization Forum 8 06-20-2008 01:58 AM
Meta keywords, descriptions and search engines allthingsyou Search Engine Optimization Forum 27 11-03-2007 07:35 PM
Google not updating meta descriptions MarkHodson Google Discussion Forum 10 06-13-2007 04:29 AM
meta tags & descriptions hijacked somjai Internet Security Discussion Forum 4 01-28-2005 05:33 AM
meta descriptions jackson992 Web Programming Discussion Forum 3 01-18-2004 09:47 PM


All times are GMT -4. The time now is 11:33 AM.



Search Engine Optimization by vBSEO 3.3.0