PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$url=$_GET['url']; if (empty($url)) { $url='index'; }
changelocation($url);
function changelocation($url) {
switch ($url)
{
case 'index':
include ('main.html');
break;
etc...
}}
?>
The issue is that I would like to have a differnt the header on each page (the purpose is to have different meta data for each page); however, I do not reallly have a clue about going about this as I already have one switch statement. Any help would be greatly appreciated.
Kinda seems like you'll have to change the fundamental workings of your site, but just in case you don't, how about posting (a) the rest of the code, and (b) main.html?
<?php
$url=$_GET['url']; if (empty($url)) { $url='index'; }
$metaDescription='what i want';
changelocation($url);
function changelocation($url) {
switch ($url)
{
case 'index':
$metaDescription='what i want for the index';
include ('header.html'); // this file contains the html <head> part
include ('main.html');
break;
etc...
}}
?>
tasairis wrote:Yeah... Not enough information for us to help.
Kinda seems like you'll have to change the fundamental workings of your site, but just in case you don't, how about posting (a) the rest of the code, and (b) main.html?
Hi thanks for the reply I figured it out. For anyone else who has the issue I simply did the following:
<?php
$url=$_GET['url']; if (empty($url)) { $url='index'; }
$metaDescription='what i want';
changelocation($url);
function changelocation($url) {
switch ($url)
{
case 'index':
$metaDescription='what i want for the index';
include ('header.html'); // this file contains the html <head> part
include ('main.html');
break;
etc...
}}
?>