Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
I have two separate problems. Of course, the first problem arose when I was trying to solve the first problem, so I'll start with that one.
I'm writing a new website and theres a small part of the stylesheet that doesn't work in IE - big surprise. Rather than rewrite my entire stylesheet I've decided to include a small embedded stylesheet that removed the affected div entirely. I was going to make this stylesheet embed ONLY if IE is detected, which brings me to my first problem: My PHP config either doesn't contain a browscap.ini file or the php.ini file isn't pointing to one. So I emailed my webhost and asked them to fix this for me. They said they don't support any changes to their default PHP config and if I wanted to customize something I would have to install one myself. So I dropped a script on my server to install PHP 4.4.2 on my server (no PHP 5, it breaks my links for some reason...), ran it, and wrote the .htaccess file. It didn't work. Any page with a .php file extention on my website is going to a 404 page. SOOOO... I have two options. 1) I could attempt to fix my PHP install, but to be honest, I am new to a lot of this and I wouldn't even know where to start. 2) Delete the .htaccess file and thereby use the preinstalled PHP 4.4.2 alread provided by my host. But then, I would need to use some other method of browser detection. (Javascript would work but javascript is client-side and therefore less reliable.) I don't need a complicated browser detect - all I need to know is when I hit an IE user. Which of these options makes more sense? And, if I should try and use my own PHP install, how do I proceed from here? Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. |
quote |
25 chars of wasted space.
|
You probably want to use conditional comments. I think they only work in IE, but that is really the point isn't it?
Code:
<style type="text/css">
@import "/inc/css/calendar.css";
@import "/inc/css/stylepicker.css";
<!--[if IE]>
#problemdiv
{
display: none;
}
<![endif]-->
</style> Anything you put in there should only work in IE. I'm not sure if you need to put specific versions or not...as in [if IE 6], [if IE 5]. But I don't think so...although you can.Anyways, if you want to use PHP, why can't you use $_SERVER['HTTP_USER_AGENT']? Last edited by ast3r3x : 2006-08-29 at 05:24. |
quote |
Senior Member
|
What's in the .htaccess?
Last edited by rollercoaster375 : 2006-08-29 at 09:58. Reason: Clarity. |
quote |
Senior Member
Join Date: Jan 2005
Location: London, UK
|
.htaccess configuration files are an Apache thing which allow you to assign custom 404 errors, password protect things, yadda yadda... wikipedia should have a good page on it
|
quote |
Senior Member
|
Oh, I know what .htaccess is. I was asking what he had in his
|
quote |
Senior Member
Join Date: Jan 2005
Location: London, UK
|
lol - oh well - it might help someone
Your post still reads strangely to me tho :P |
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Not much.
In fact, that might be the problem. There are only two lines in my .htacccess file, they are: AddHandler phpFour .php Action phpFour /cgi-bin/php.cgi |
quote |
BANNED
|
How unhelpful would it be, on a scale of 1-10 (where 10 is very unhelpful and 1 is only a little bit unhelpful), for me to suggest you scrap the entire project, and start over in Ruby on Rails?
|
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Quote:
Going back to PHP, would this do the trick: [PHP]<style type="text/css"> <?php $_SERVER['HTTP_USER_AGENT'] = $browser; if (stristr ($browser,"msie")) { require 'css/navoverride.css'; // the CSS required to kill the IE-offending div is here } ?> </style> [/PHP] If so, it would save me a whole lot of trouble. Thanks for the tip, ast3r3x! Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. |
|
quote |
25 chars of wasted space.
|
Why don't you want to use conditional arguments and save yourself all the PHP trouble?
|
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Quote:
Maybe once Parallels has Mac Pro support, I'll try that out. Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. |
|
quote |
New Member
Join Date: May 2006
|
Quote:
[PHP]<style type="text/css"> <?php $browser = $_SERVER['HTTP_USER_AGENT']; if (stristr ($browser,"msie")) { include('css/navoverride.css'); // the CSS required to kill the IE-offending div is here } ?> </style>[/PHP] |
|
quote |
Lovable Bastard
Join Date: Dec 2005
Location: Boston-ish
|
Quote:
That all said, am still just a PHP newb. Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end. |
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |