Page 2 of 2

Posted: Mon Feb 26, 2007 4:30 pm
by nimmØ2
Now I'm a bit more confused.

As far as I know, all that information should be in my .css file. Maybe I don't understand how it works.

I'm not familiar with XHTML, just the current version of HTML (four, I assume).

What I'm trying to achieve is for the header to load the .css file into the page.
I'd like to be able to use the 'include' function so I don't have to insert that code into all of my headers.


Thanks for your help.

(and that is what's there right now, as far as the files go)

Posted: Mon Feb 26, 2007 4:43 pm
by feyd
array_rand() returns the index of the element it selected, not the element itself. Next, remove the last / from your echo of the <link> tag. And finally, add a <!DOCTYPE> like

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Thanks.

Posted: Tue Feb 27, 2007 3:34 am
by nimmØ2
Ah, thanks. Would that go in the header? Before it?

hmm.

would this work?

Code: Select all

$cssFiles = array('fileone.css','filetwo.css','filethree.css');
$randomCssFile = $cssFiles[(array_rand($cssFiles))];
echo '<link href="' . $randomCssFile . '" rel="stylesheet" type="text/css" />';

Re: Thanks.

Posted: Tue Feb 27, 2007 3:56 am
by AshrakTheWhite
it returns the key..

Code: Select all

array
(
    [key] => value
    [key2] => value2
)

Posted: Tue Feb 27, 2007 7:54 pm
by nimmØ2
Confused.