473,231 Members | 1,742 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,231 software developers and data experts.

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

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.


Jul 17 '05 #1
3 3184
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).

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.

Jul 17 '05 #3
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" />

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

Thanks people.


Jul 17 '05 #4

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

Similar topics

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...
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...
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...
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 ...
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
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...
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...
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...
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...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.