473,473 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

generating a css file incude using $_SERVER['SERVER_NAME'];

Hi
can anyone tell me why this doesn't work:
<link rel="stylsheet" href="http://<?php echo $_SERVER['SERVER_NAME'];
?>/includes/test3.css" type="text/css" />

there is no wrap in the actual file.

when I view the source the code is printing the correct information.

I think I picked a good one for my first attempt at php. I am trying to
create a generic template.

cheers

Jim
Jul 17 '05 #1
3 3195
junk wrote:
can anyone tell me why this doesn't work:
<link rel="stylsheet" href="http://<?php echo $_SERVER['SERVER_NAME'];
/includes/test3.css" type="text/css" />


When you paste the printed stylesheet href in your browser and are able to
retrieve it from there, there's probably an error in the css file when it
isn't rendered the way you expected it to.

It might also be useful to use HTTP_HOST rather then SERVER_NAME (which can
be 2 different things).
JW

Jul 17 '05 #2
junk wrote:
can anyone tell me why this doesn't work:
<link rel="stylsheet" href="http://<?php echo $_SERVER['SERVER_NAME'];
?>/includes/test3.css" type="text/css" />
A missing 'e' in the value of the rel attribute; it should
read 'stylesheet', I suppose, not 'stylsheet'.
there is no wrap in the actual file.


That makes no difference because white space between your
PHP tags isn't outputted.

--
Jock
Jul 17 '05 #3
junk wrote:
Hi
can anyone tell me why this doesn't work:
<link rel="stylsheet" href="http://<?php echo $_SERVER['SERVER_NAME'];
?>/includes/test3.css" type="text/css" />


ROFLMAO.. It was the missing "e" in "stylesheet"
Now I better go read the manual about HTTP_HOST

Thanks people.

cheers

Jim
Jul 17 '05 #4

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

Similar topics

9
by: Jez | last post by:
Any ideas why I'm not able to use $_SERVER on my shared hosting account (PHP 4.1.2), but I can on my local server (PHP 4.3.3)? I imagine it has something to do with the different versions of PHP...
23
by: deko | last post by:
Can someone point me to a sample script that will log all visitors to my web site? I'm looking for a simple script that will capture IP address, Host Name, Browser, OS, and referring page - and...
7
by: Phi | last post by:
Hi there, I've just started learning php and I hope you guys could help me with this problem. I've found a useful pice of code from a book to make a form and I would like to use it. I would like...
10
by: Jim Carlock | last post by:
Looking for a way to extract the path from the pfqpn (partially full qualified path name). $sThisServer = $_SERVER; // returns either aquaticcreationsnc.com or www.aquaticcreationsnc.com ...
5
by: julian_m | last post by:
<? //file test.php phpinfo(); $filename = "test.php"; //it does not work $filename = $_SERVER."/home/ke000067/public_html/test.php"; //it does not work
0
by: Patrick | last post by:
Greetings, I'm running into an intermittant issue on a web site running dotNet 1.1 sp1. The global.asax the client is using is set up so that it can be used in production, developement, and...
1
by: laredotornado | last post by:
Hi, If I have multiple domains (mydomain1.com, mydomain2.com, mydomain3.com) pointing at the same IP, will the call echo $_SERVER{'SERVER_NAME']; return the domain name people type into the...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
2
by: klehonia | last post by:
Hi, i have a php server on iis6 win2003. When i write in index.php <? phpinfo(); ?> it brings me the information of php server _SERVER the name of localhost, but when i write the variable...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.