+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Using a .php file as a stylesheet

  1. #1
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Using a .php file as a stylesheet

    I have successfully used in the past .php files as external stylesheets (instead of .css), but i discovered that when I include a doctype tag (I forget which doctype), this does not work anymore. Is there any reason for this?

    (Tested on Chrome, Firefox and Opera)
    Last edited by shant93; 12-28-2010 at 12:57 PM.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Using a .php file as a stylesheet

    Maybe because external stylesheets don't use xml and including a doctype tag causes the browser to abort processing the file?
    Nothing is always absolutely so.

  3. #3
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: Using a .php file as a stylesheet

    I tried using two identical external files, one as .css and the other as .php, and only the .css worked.

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Using a .php file as a stylesheet

    What happens when you try to access the .php file directly?
    Nothing is always absolutely so.

  5. #5
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: Using a .php file as a stylesheet

    It loads properly and the browser interprets it as HTML code. Both with and without generated content.
    Last edited by shant93; 12-28-2010 at 01:00 PM.

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Using a .php file as a stylesheet

    Got URL?

    Got script?

    Got plain text?
    Last edited by descalzo; 12-28-2010 at 01:02 PM.
    Nothing is always absolutely so.

  7. #7
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: Using a .php file as a stylesheet

    No, it's on local server, but anyways, I made sure there was no other problem, and that the doctype was the only thing causing the issue.
    I just wanted to know why doctype declerations would go against that.
    Last edited by shant93; 12-28-2010 at 01:03 PM.

  8. #8
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Using a .php file as a stylesheet

    Then, why add the doctype?
    Nothing is always absolutely so.

  9. #9
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: Using a .php file as a stylesheet

    Oh, that was accidental, I was lazy and pasted some header code from a tut I was reading and had a doctype decleration, and it took me two long frustrated hours to figure out the issue. Just curious and would like to know more so that I, and others, can avoid this in the future.

  10. #10
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Using a .php file as a stylesheet

    Well, without the code etc, I have no idea.
    Nothing is always absolutely so.

+ Reply to Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. External stylesheet stopped working suddenly?
    By meithan in forum Graphics & Webdesign
    Replies: 2
    Last Post: 07-06-2010, 11:40 PM
  2. Stylesheet exploded
    By as4s1n in forum Programming Help
    Replies: 2
    Last Post: 03-07-2010, 03:01 AM
  3. Replies: 0
    Last Post: 02-21-2009, 12:25 PM
  4. CSS Stylesheet
    By sa4amz in forum Free Hosting
    Replies: 1
    Last Post: 10-05-2008, 02:52 PM
  5. Help: stylesheet not updating
    By cashguy in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 09-19-2007, 01:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers