Will a suggestion in this article about PHP put browsers into quirks mode?

Discussion in 'HTML' started by patrick j, Mar 30, 2007.

  1. patrick j

    patrick j Guest

    Hi

    I'm just exploring the world of PHP and very interesting it is too :)

    Anyway the thing which has interested me initially is putting the
    navigation section of the web-site into a separate file to be included in
    all the other pages of the web-site.

    Very cool is the fact that with some jiggerypokery with a variable I can
    have the included navigation identify the "current" link.

    This is all described rather well in this article here:

    <http://alistapart.com/articles/keepingcurrent/>

    However there is one thing which I'm wondering about which in this bit:

    You¹ll need to add a unique identifier at the very top
    of every page that PHP will understand, ideally
    appearing before the HTML tag. You¹ll do this by
    creating a variable called $thisPage and assigning a
    value that is both descriptive and unique to the
    document.

    Okay, if I put my <?php $thisPage="Interesting Stuff"; ?> before the HTML
    tag does this not put some browsers into quirks mode?

    I'm wondering why the author feels it would be ideally located before the
    HTML tag, surely it would only have to be in each page before the include
    for the navigation section?

    Thank you.

    --
    Patrick - Brighton, UK
    If you wish email me from my web-site: <http://www.patrickjames.me.uk>
    Inventory service in Sussex: <http://www.inventoryworks.co.uk>
     
    patrick j, Mar 30, 2007
    #1
    1. Advertising

  2. Re: Will a suggestion in this article about PHP put browsers intoquirks mode?

    patrick j wrote:

    > Okay, if I put my <?php $thisPage="Interesting Stuff"; ?> before the HTML
    > tag does this not put some browsers into quirks mode?


    No, the browser does not even see it, there is no output. You are just
    setting a variable on the *server*.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 31, 2007
    #2
    1. Advertising

  3. patrick j

    patrick j Guest

    Re: Will a suggestion in this article about PHP put browsers into quirks mode?

    On Mar 31, 2007 Jonathan N. Little wrote:

    > patrick j wrote:
    >
    >> Okay, if I put my <?php $thisPage="Interesting Stuff"; ?> before the HTML
    >> tag does this not put some browsers into quirks mode?

    >
    > No, the browser does not even see it, there is no output. You are just
    > setting a variable on the *server*.
    >
    >


    A yes that makes a great deal of sense.

    I am getting the hang of it gradually, honest :)

    --
    Patrick - Brighton, UK
    If you wish email me from my web-site: <http://www.patrickjames.me.uk>
    Inventory service in Sussex: <http://www.inventoryworks.co.uk>
     
    patrick j, Mar 31, 2007
    #3
  4. patrick j

    dorayme Guest

    In article
    <>,
    patrick j <> wrote:

    > Very cool is the fact that with some jiggerypokery with a variable I can
    > have the included navigation identify the "current" link.


    > This is all described rather well in this article here:


    > <http://alistapart.com/articles/keepingcurrent/>



    So! A way to get rid of all the hand inserted class="current"s.
    Excellent.

    --
    dorayme
     
    dorayme, Mar 31, 2007
    #4
  5. patrick j

    patrick j Guest

    On Mar 31, 2007 dorayme wrote:

    > So! A way to get rid of all the hand inserted class="current"s.
    > Excellent.


    Yes, I thought exactly the same when I saw it :)



    --
    Patrick - Brighton, UK
    If you wish email me from my web-site: <http://www.patrickjames.me.uk>
    Inventory service in Sussex: <http://www.inventoryworks.co.uk>
     
    patrick j, Mar 31, 2007
    #5
  6. Gazing into my crystal ball I observed dorayme
    <> writing in
    news::

    > In article
    ><>,
    > patrick j <> wrote:
    >
    >> Very cool is the fact that with some jiggerypokery with a variable I
    >> can have the included navigation identify the "current" link.

    >
    >> This is all described rather well in this article here:

    >
    >> <http://alistapart.com/articles/keepingcurrent/>

    >
    >
    > So! A way to get rid of all the hand inserted class="current"s.
    > Excellent.
    >


    Yes, dear, and you can even make an array/function to do it. Just make
    your array contain the page names and links, then while loop through
    send the info to the function to see if $thispage is the current page,
    and add your class. Easy peasy!

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Mar 31, 2007
    #6
  7. patrick j

    dorayme Guest

    In article <Xns99042F6B5511arbpenyahoocom@69.28.186.121>,
    Adrienne Boswell <> wrote:

    > Gazing into my crystal ball I observed dorayme
    > <> writing in
    > news::
    >
    > > In article
    > ><>,
    > > patrick j <> wrote:


    > >> This is all described rather well in this article here:

    > >
    > >> <http://alistapart.com/articles/keepingcurrent/>

    > >
    > >
    > > So! A way to get rid of all the hand inserted class="current"s.
    > > Excellent.
    > >

    >
    > Yes, dear, and you can even make an array/function to do it. Just make
    > your array contain the page names and links, then while loop through
    > send the info to the function to see if $thispage is the current page,
    > and add your class. Easy peasy!


    Like uneaten chocolates, all these wonderful things are there,
    one only needs to open the lid and pick and choose.

    --
    dorayme
     
    dorayme, Mar 31, 2007
    #7
  8. patrick j

    Andy Dingley Guest

    On 31 Mar, 00:59, dorayme <> wrote:

    > A way to get rid of all the hand inserted class="current"s.


    You can ditch almost all of those by adding a class="foo-section" to
    the <body> and testing for equivalence to foo-section within the page,
    rather than having to add class="current" to every location that needs
    it. More complex CSS selectors in one file, rather than repeated
    additions throughout the pages. Works with SSI too.
     
    Andy Dingley, Apr 2, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Thies

    quirks mode and IE5 vs IE6

    Jeff Thies, Feb 12, 2004, in forum: HTML
    Replies:
    26
    Views:
    2,512
    =?ISO-8859-1?Q?Andr=E9s_Sedano?=
    Feb 14, 2004
  2. Michael Jaeger

    quirks mode

    Michael Jaeger, Apr 28, 2004, in forum: HTML
    Replies:
    10
    Views:
    914
    Jeff Thies
    May 5, 2004
  3. Simon Brooke
    Replies:
    4
    Views:
    485
    Johannes Koch
    Mar 23, 2007
  4. Summercool
    Replies:
    2
    Views:
    496
  5. Rajive Narain
    Replies:
    0
    Views:
    2,091
    Rajive Narain
    Sep 18, 2009
Loading...

Share This Page