Jump to content


Photo

<s Error?


  • Please log in to reply
2 replies to this topic

#1 levi2613

levi2613
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 28 June 2006 - 02:57 PM

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.

<?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";
  }
?>

Thanks for any help...

#2 levi2613

levi2613
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 29 June 2006 - 02:47 PM

*bump*

#3 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 29 June 2006 - 02:54 PM

Could it be the default case? You don't set anything in that situation. If not can you give us some more information? What is the user looking, case wise, and what is supposed to display? As I understand you the entire site isn't displaying and only the CSS background + the text <s .
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users