Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-04-2013, 01:15 AM   PM User | #1
jump
New to the CF scene

 
Join Date: Mar 2013
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
jump is an unknown quantity at this point
Can someone tell me what this means?

This code appears at the top of my "header" before the:

<html> tags.

Code:
<?
  $class = array();
  if (isset($menu)) {
    $class[$menu] = " class=\"selected\" ";
    
  }
  if ($menu == "contact") 
    $class["contact"] = " class=\"selected last\"";
  else
    $class["contact"] = " class=\"last\"";
  
?>
Is it important? How can it even be "read" by web browsers if it is before the HTML tags?
jump is offline   Reply With Quote
Old 03-04-2013, 01:22 AM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,454
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by jump View Post
This code appears at the top of my "header" before the:

<html> tags.

Code:
<?
  $class = array();
  if (isset($menu)) {
    $class[$menu] = " class=\"selected\" ";
    
  }
  if ($menu == "contact") 
    $class["contact"] = " class=\"selected last\"";
  else
    $class["contact"] = " class=\"last\"";
  
?>
Is it important? How can it even be "read" by web browsers if it is before the HTML tags?
That looks like PHP - the way it is coded provided shorttags is enabled that code will be run before the page is sent to the browser. The values set in the array are probably being substituted into the HTML lower down in the page and attach classes to the spots where they are being applied that will affect how those parts of the page look.

That code should not be sent to the web browser and so the web browser will not do anything with what it didn't get.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 03-04-2013, 01:30 AM   PM User | #3
jump
New to the CF scene

 
Join Date: Mar 2013
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
jump is an unknown quantity at this point
Well initially my website was set up to draw code from a header (where that code was find) that contained all of the top-level tags (HTML, HEAD, BODY,etc.) but I had to copy and paste all of the text within the HTML tags because this didn't allow for title tag customization among other things. So I can just disregard this, correct?
jump is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:52 PM.


Advertisement
Log in to turn off these ads.