SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ditching stylesheets

    Hey, this is just a general question. Can someone tell me why occasionally my browser will just ditch a stylesheet, and use default fonts etc.

    I notice it the most here in these forums, sometimes when I post, and get taken back to my post, the formatting is gone. Is this a CSS problem, a browser problem (IE) or a VBulletin problem?
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  2. #2
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This doesn't seem to happen much to me although sometimes the links and things do seem to change between pages....

    Perhaps with all of the PHP and MySQL processes a stylesheet file is just not included? I know when using includes in PHP, somtimes (albeit very rarely), a file just isn't included -- like it is a bug in PHP.

    That's the best answer ... err ... conjecture I can give.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  3. #3
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THat would make sense, because if you then refresh the page it normally sorts itself out, as if PHP is saying "I'm too busy putting your post in without worrying how it's gonna look - give me a break!"

    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  4. #4
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup. That makes sense to me -- everything has its limits, including that godly language we know to be PHP.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  5. #5
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only problem with that theory is that (at least here) the CSS is included by HTML, not PHP. Keep in mind that the PHP engine only returns information - it is up the browser to correctly interpret formatting and display that information. In the case of this page, PHP returns an HTML page which has a <link href="styles.css" type="text/css" rel="stylesheet"> tag in it to the browser - then the browser finds that tag and gets the external style sheet file and includes it. So PHP really never touches the style sheet.
    Kevin

  6. #6
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What if the PHP file is including the HTML contents that link to the stylesheet though? That's what I was assuming was happening.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  7. #7
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP still isn't actually including the style sheet - it is passing a completed HTML page to the browser (including a style sheet link tag) for the browser to process. PHP doesn't understand HTML tags.
    Kevin

  8. #8
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so what you are saying is PHP is THAT powerful that it managed to trick my browser in to forgetting to use the stylesheet?

    Clever ol' PHP...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  9. #9
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  10. #10
    Non-Member Siltrince's Avatar
    Join Date
    Aug 2001
    Location
    Belgium
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know PHP yet but someone here said that the stylesheet has nothing to do with the PHP and isn't he right ?

    I do know stylesheets and what he said makes sence to me , why would your browser forget to use the CSS ??

    The first thing your browser does is getting the external CSS-file and then executes the scripting so i really don't understand why the browser does that.

  11. #11
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Getting the external style sheet is not the first thing the browser does, when loading these forums. It is going through several thousand lines of PHP code, as well as grabbing content from a database and then inserting that into some fairly complicated template designs.

    Getting the stylesheet is one of the last things it does, as it is simply applying formatting to the content, and it is not surprising it can occasionally get lost in amongst some fairly intensive operations.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  12. #12
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [offtopic] weirdbeardmt: I *love* your avatar - that was an awesome movie [/offtopic]

    Actually the browser never touches the PHP code. Here is what happens when your browser requests a file from the server in this type of forum:

    1) Browser sends a request, which the server receives and sends back an initial response (OK, not found, authorization, etc.).

    2) The server finds the file, determines that it needs to run it through the PHP engine, and does so. It feeds it in one end and out the other end comes pure HTML which is collected in a bucket of sorts.

    3) The server sends the bucket of HTML back to the browser, drop by drop (packet by packet). The browser receives and assembles it, laying out the page and doing anything required of it (including retreiving the external style sheet). The browser then displays the page.

    As you can see, the browser never gets PHP code, and the server never touches the stylesheet.
    Kevin

  13. #13
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by tubedogg
    [offtopic] weirdbeardmt: I *love* your avatar - that was an awesome movie [/offtopic]
    Thanks!


    Actually the browser never touches the PHP code. Here is what happens when your browser requests a file from the server in this type of forum:

    1) Browser sends a request, which the server receives and sends back an initial response (OK, not found, authorization, etc.).

    2) The server finds the file, determines that it needs to run it through the PHP engine, and does so. It feeds it in one end and out the other end comes pure HTML which is collected in a bucket of sorts.

    3) The server sends the bucket of HTML back to the browser, drop by drop (packet by packet). The browser receives and assembles it, laying out the page and doing anything required of it (including retreiving the external style sheet). The browser then displays the page.

    As you can see, the browser never gets PHP code, and the server never touches the stylesheet.
    This is what I meant, but in a less drastic way -- point 3 there, all the processes,lines of code etc that the php engine has gone through to to create these forums are fairly epic, in the meantime, the browser is sat here waiting to display something to its user. When it does get something back, it is in quite a hurry to show it, and therefore it isn't too surprising when occasionally it misses something...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  14. #14
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *sneak up behind everone with a megafone* PHP SUCKS!! *runs like hell*

  15. #15
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *acute hearing catches dhtmlgod before has a chance to run away, swings round, grabs microphone, and shoves it somewhere particularly uncomfortable*
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  16. #16
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh yeah

    Code:
    Set objDBCon = Server.CreateObject("ADODB.Connection")
    strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappathweirdbeardmt.brain")
    objDBCon.open strConnect
    objDBCon.Execute("DELETE * FROM brain_Area")

  17. #17
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats a nice looking script. word of warning though, good luck finding my brain. if you do find it can you let me know!? ive been searching for it for ages...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •