Page 1 of 1

Switch problem

Posted: Fri Feb 15, 2008 7:26 am
by Sindarin
I have created a dynamic footer for a client's page:

Code: Select all

<!--page inclusion-->   
<?php   
switch($_GET['page']){
  case 'contact':
      echo "";
  break;
  case 'products':
      echo "
<table width='781' height='121' border='0' align='center' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='36' colspan='2' align='left' valign='top' class='style10a'></td>
  </tr>
  <tr>
    <td width='423' align='left' valign='top'></td>
    <td width='358' align='left' valign='top'>
<img src='images/index/enosi.jpg' alt='' width='347' height='85' /></td>
  </tr>
</table>";
  break;
  default:
      echo "<table width='781' height='121' border='0' align='center' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='36' colspan='2' align='left' valign='top' class='style10a'></td>
  </tr>
  <tr>
    <td width='423' align='left' valign='top'></td>
    <td width='358' align='left' valign='top'>
<img src='images/index/enosi.jpg' alt='' width='347' height='85' /></td>
  </tr>
</table>";
}
include_once($include);
?>
I have created that way that in every page except contact the logo appears at the page footer. Problem is that they also want the logo out of the index page. Now, if I remove the code in the default section, it will be removed as well to all other pages, and I don't want to add other cases for each and every page.

Re: Switch problem

Posted: Fri Feb 15, 2008 7:57 am
by Zoxive
I'm guessing $_GET['page'] is empty for the index page?

Code: Select all

case '':
// --------
break;

Re: Switch problem

Posted: Fri Feb 15, 2008 8:03 am
by Sindarin
Yes, it's just index.php

Thanks, it works.