473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CSS files

Des
I have renamed all my files from html to PHP. The first problem I
have is CSS can anyone tell me the equivelent for this please.

The URL for this site is http://www.hopechurchuk.com/Development

Desmond.

Aug 12 '05 #1
5 1351
NC
Des wrote:

I have renamed all my files from html to PHP. The first problem I
have is CSS can anyone tell me the equivelent for this please.


The equivalent for WHAT? Your PHP files can refer to an external
stylesheet just like your HTML files do...

Cheers,
NC

Aug 12 '05 #2
NC wrote:
Des wrote:
I have renamed all my files from html to PHP. The first problem I
have is CSS can anyone tell me the equivelent for this please.

The equivalent for WHAT? Your PHP files can refer to an external
stylesheet just like your HTML files do...

Cheers,
NC


And to add to that, your HTML files only need to be renamed if they
contain PHP.
Aug 15 '05 #3
*** Des wrote/escribió (12 Aug 2005 13:46:50 -0700):
I have renamed all my files from html to PHP. The first problem I
have is CSS can anyone tell me the equivelent for this please.


If you need to execute PHP code in your CSS files, just rename them to
*.php and provide the appropriate headers:

<?php

header('Content-Type: text/css');

....

?>

If I were you, I would also test whether browsers cache this CSS. It'd be
stupid if it was requested to the server on each page view.

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Aug 16 '05 #4
<comp.lang.php , Alvaro G Vicario ,
al******************@telecomputer.com>
<14*****************************@40tude.net>
<Tue, 16 Aug 2005 13:06:34 +0200>
If you need to execute PHP code in your CSS files, just rename them to
*.php and provide the appropriate headers:

<?php

header('Content-Type: text/css');

...

?>


Funnily enough I was wondering how to use php in css files last night .

Any problems or pitfalls with the method ? .
--
www.phpguestbook.co.uk
Aug 20 '05 #5
*** PHPGB wrote/escribió (Sat, 20 Aug 2005 13:39:07 +0100):
Funnily enough I was wondering how to use php in css files last night .

Any problems or pitfalls with the method ? .


As I mentioned, PHP default config makes browsers reload a *.php document
from server everytime it's needed, and the whole point of external CSS
files is having them cached. Yet you can change this behaviour playing
around with header() function. Just be aware of it.

I don't know if there're other problems: I'd just test it under Internet
Explorer, which is the only known browser that prefers file extensions over
Content-Type headers.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Aug 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
18
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now...
3
by: pooja | last post by:
Suppose i have created a class c1 with f1()in c1.cpp and included this c1.cpp in file1.cpp file , which is also having main() by giving the statement #include "c1.cpp". the same i can do by...
11
by: ambika | last post by:
Iam just trying to know "c". And I have a small doubt about these header files. The header files just contain the declaration part...Where is the definition for these declarations written??And how...
22
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
0
by: wal | last post by:
How does one attach files to emails using libgmail? The following code http://pramode.net/articles/lfy/fuse/4.txt works fine when said files are simple text files, but it failes as soon as the...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.