We help IT Professionals succeed at work.
Get Started

Meta tag depending of selected and title

lenamtl
lenamtl asked
on
551 Views
Last Modified: 2012-06-27
Hi,

I'm aware about Google ignore most of the time, meta tag and use content. (This is not the point here)

I'm working on an existing web site, not created by me. I need a quick solution, I guess with variables.

The website construction: (no known template system)

index.html which is presentation page with language selection

 menu, content, footer several content pages that are embedded by index.php

What I need to do only for those 2 pages welcome_en.html and welcome_fr.html (these pages are embedded so no header possible on these page) to have different page title (browser title) and different META tag.

Any solution is welcome

Thanks

extra information

Language detection code on index.php:

<?php
$lang = $_GET['lang'];
$page = $_GET['page'];
if ($_GET['page'] == "" || !$_GET['page']) {
$page = "welcome";
}
if ($_GET['lang'] == "" || !$_GET['lang']) {
$lang = "_fr";
}
?>

Open in new window



for the embeded menu, footer ect like this one

<?php include "menu.php";
  ?>

Open in new window


for the embedded content
<?php
        //echo "$page$lang.html";
        $lang = preg_replace('/[^a-z0-9_ ]/i', '', $_GET['lang']);
        $page = preg_replace('/[^a-z0-9_ ]/i', '', $_GET['page']);
        include $page . $lang . ".html";
  ?>

Open in new window


The header info Meta tag and title are in index.php for all pages with no variables.

PS II'm not using any CMS or Framework or template system and don't want to use them.
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE