Web Analytics Made Easy -
StatCounter converting html to php, css not read - CodingForum

Announcement

Collapse
No announcement yet.

converting html to php, css not read

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • converting html to php, css not read

    Hi, I'm in the process of changing the html pages of my website into php. The problem I am having is when I change the .html to .php, the webbrowser stops applying the external css to the page. The external stylesheet is applied when it has the .html extension but not when I change it to .php.

    The external stylesheet is in the header as:

    <link rel="stylesheet" type="text/css" href="http://www.mysite.com/1/uti/main.css" />

    How do I get the css to apply to the website once it is changed from .html to .php?

    Thank you!

  • #2
    .PHP doesn't break a CSS load. The problem will be your output HTML. For that you'll need to check the HTML source to ensure that the proper path has been placed in it.
    Unless you mean that the .css has been converted to PHP (rare to do this), in which case you would load a .php file and best to push a header for a content type of text/css (although not really necessary).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

    Comment


    • #3
      only some of the css is not translating

      Maybe you can tell me what I am doing wrong, as it seems only some of the css is translating.
      [Links removed]
      Last edited by Fou-Lu; Aug 29, 2011, 08:15 PM.

      Comment


      • #4
        We better take those links out as this is not an adult friendly website.

        Check your source, you're PHP is repeating the starting <html> section twice in the code. The body itself is not repeated, but I'm willing to bet that'll be a large part of the problem.
        The HTML you have in here is quite old as well. Use the validator at validator.w3.org to verify the HTML to doctype in use. There is also a css validator on their website to ensure that the CSS is also standards compliant.
        PHP Code:
        header('HTTP/1.1 420 Enhance Your Calm'); 
        Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

        Comment


        • #5
          Originally posted by Fou-Lu View Post
          We better take those links out as this is not an adult friendly website.
          Sorry for straying off topic but it's "not an adult friendly website"? So it's kid friendly? Or do you mean it's not "Family Friendly"?
          Dawson Irvine
          CEO - DNI Web Design
          http://www.dniwebdesign.com

          Comment


          • #6
            Originally posted by dniwebdesign View Post
            Sorry for straying off topic but it's "not an adult friendly website"? So it's kid friendly? Or do you mean it's not "Family Friendly"?
            Yeah I was confused when I read that too. I guess Fou-Lu was blinded by his newly acquired 5 digit post count.

            The links that were posted were to an adult orientated website. What I think Fou-Lu was trying to say was: Those kinds of links aren't allowed since CodingForum is a family friendly place. And we have some members that are young.

            The OP can still get help though.
            OracleGuy

            Comment


            • #7
              Oops, I actually meant not an 'adult website friendly forum'. Lol. You got what I meant so its all good.
              PHP Code:
              header('HTTP/1.1 420 Enhance Your Calm'); 
              Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

              Comment


              • #8
                THanks

                Thanks for the reply! Sorry for the links, I guess I wasn't thinking, sorry if I offended!

                Comment

                Working...
                X