aaron_nimocks
Jun 8th 2007, 11:00 am
I have a 50 page site that uses PHP. Im looking at making meta descriptions for each page. Now the easiest way I can think of is using cases.
Now Im looking at just doing cases based on the URL. So the depending on the URL I can enter a varialble for the meta description.
Heres the basic idea but it dont work.
<?php
switch ($_SERVER["PHP_SELF"])
{
case "/page1":
$description = "page 1 description";
break;
case "/page2":
$description = "page 2 description";
break;
case "/page3":
$description = "page 3 description";
break;
}
?>
Could anyone help me complete my idea. Im a little confused on what to use for the switch.
Thanks
Now Im looking at just doing cases based on the URL. So the depending on the URL I can enter a varialble for the meta description.
Heres the basic idea but it dont work.
<?php
switch ($_SERVER["PHP_SELF"])
{
case "/page1":
$description = "page 1 description";
break;
case "/page2":
$description = "page 2 description";
break;
case "/page3":
$description = "page 3 description";
break;
}
?>
Could anyone help me complete my idea. Im a little confused on what to use for the switch.
Thanks