Jump to content

Recommended Posts

Standard disclaimer: I am *very* new to php.... Please be kind to my stupidity....

So I've made this whole little website thing that usually works pretty well. In order to economize code, I made a small php function that spits out the header based on where you are. One person has reported that sometimes, instead of the page loading like normal, they get the background image and a text "<s" at the top. He sent me the screenshot, and sure enough, that's all that comes up. I imagine the problem is with the .inc header file because the CSS stylesheet brings up the background image OK, but *none* of the header or the code from the page itself gets written.

It is an .htaccess protected site if that makes a difference.... The header file is below.

[code]
<?php

  function print_header($location) {
  
     $at_home = "";
     $at_schedule = "";
     $at_calendar = "";
     $at_forum = "";
     switch ($location) {
        case 'home':
           $at_home = "onclick=\"return false;\" style=\"color:#269;text-decoration:none\"";
           break;
        case 'schedule':
           $at_schedule = "onclick=\"return false;\" style=\"color:#269;text-decoration:none\"";
           break;
        case 'calendar':
           $at_calendar = "onclick=\"return false;\" style=\"color:#269;text-decoration:none\"";
           break;
        case 'forum':
           $at_forum = "onclick=\"return false;\" style=\"color:#269;text-decoration:none\"";
           break;
        default:
           break;          
     }
  
     echo "<!--          -->
           <!--  HEADER  -->
           <!--          -->\n\n";
          
     echo "<div id=\"sitetitle\">
           <a href=\"../\"><h1>Welcome</h1></a>
           </div>\n\n";

     echo "<!--                  -->
           <!--  NAVIGATION BAR  -->
           <!--                  -->\n\n";

     echo "<div id=\"menu\">
           <a href=\"index.html\" $at_home>home</a>
           <a href=\"schedule/\" $at_schedule>schedule</a>
           <a href=\"calendar/\" $at_calendar>calendar</a>
           <a href=\"phpBB2/login.auto.php\" $at_forum>forum</a>
           </div>\n\n";
  }
?>
[/code]

Thanks for any help...
Link to comment
https://forums.phpfreaks.com/topic/13116--/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.