tags:

views:

89

answers:

1

Hi,

I have this code:

$newphrase = str_replace('href="/Css/IE6.css"', 'href="http://www.company.com/pgrddedirect/iefix.css"', 'href="/Css/IE6.css"');

So that I can search the html file in php using DOM in an attempt to modify the location of the .css file before I redisplay it. I intend on uploading the new .css file to my server and when I display the page with my php I want to first edit the location lines of the css so that I can resdisplay it with my own. The code can find and edit the html but I don't know how to save it before displaying it.

Cheers

A: 
NullUserException
Hi, I only need to change 3 of them and I cannot do it manually as the website is part of our company but not accessible for editing. Would there be an easier way using DOM to do this?
Jeremy
You can't even edit the CSS itself? WTH?
NullUserException
I am editing the css file and uploading it on a different server, so that I can link the html page to the edited css.
Jeremy
Its defined like this:<!--[if IE 6]><link rel="stylesheet" type="text/css" href="/Css/IE6.css" media="screen" /><![endif]--><!--[if IE 7]><link rel="stylesheet" type="text/css" href="/Css/IE7.css" media="screen" /><![endif]--><!--[if IE 8]><link rel="stylesheet" type="text/css" href="/Css/IE8.css" media="screen" /><![endif]-->I want to change each one to link to a different address in the href section.
Jeremy
Why can't you replace the original CSS files?
NullUserException
Because they exist on a server that we are not allowed to touch (a subsidiary companies server). We changed systems which meant we needed to screen scrap their existing site. This works well for all browsers apart from IE, so we need to edit their css files for IE so that we can make the site look correct.
Jeremy
It's immaterial to the answer why the circumstances are as they are.
Shabbyrobe
@Jeremy I think I got what you are saying. See my edit.
NullUserException
@Shabby It's not - depending on the circumstances there might be a better option
NullUserException