Help with a simple PHP code

I have a site that is build around Drupal (My site is fixtr.dk)

Drupal has a page.tpl.php file that has the following code.

  <meta name="description" content="My description" />
  <meta name="keywords" content="My keywords" />

My problem is that I need a different description and keywords for different sub pages.

So when I am on the front page “fixtr.dk” i need one set of keywords and a specific frontpage description. Then when you go to a sub page like “fixtr.dk/kategori/Teknik_&_IT” i need other meta keywords and another description.

So I need a:

If URL = X echo &

If URL = Y echo &

I can’t code PHP or any other real programming language, so I need a working script.

Any help would be very much appreciated.

This is a general programming question. You likely won’t find a script. You do it this way in any language:

If I can get past the captcha, here is how:

if (site == ‘X’)
{
str = “whatever/pageX”; ///// your path is whatever you want
}
elseif (site == ‘Y’)
{
str = “whatever/page2/…/pageY”;
}
… elseif … etc.
else // last page
{
str = “whatever/page5555…/…/pageZ”;
}

then

echo " … $str …"; // will print the ‘str’ value in the text… usually
or you can do echo “…” . $str . “…”;

** I’ve omitted the nonsensical dollar signs in most code; you know to put them in for php

Sponsor our Newsletter | Privacy Policy | Terms of Service