Page 1 of 1

CSS not working with PHP script

Posted: Mon Aug 04, 2003 10:42 am
by Avalon
I'm having a problem with text formatting properly when I use a PHP script in the middle of an HTML page. I've linked in a stylesheet in the HTML header:

Code: Select all

<link href="../style.css" rel="stylesheet" type="text/css" />
and it works fine until I add PHP into the mix. At the moment the code I'm using is:

Code: Select all

<td width="465" valign="top" class="main">
              <?php require("listreviews.php"); ?>
            </td>
but the text is showing using the default font and link colours. The script listreviews.php is pulling some information from a database and then displaying it using echo. I've also tried replacing the require line with a simple echo statement and the text still shows up wrong. Is there something simple I'm overlooking? The script seems to be working fine except for causing the formatting to mess up.

This is the page in question: http://mlhogan.com/test/read/reviews.php

Posted: Mon Aug 04, 2003 11:28 am
by Stoker
I get a 404 Not found when trying to access http://mlhogan.com/test/style.css

Edit/add: Has nothing to do with PHP, most likely you forgot to copy or symlink the CSS file (Or use absoulte path) when creating the test stuff..

Posted: Mon Aug 04, 2003 11:38 am
by Telos
Try include instead of require....Don't know if there's any difference but worth to try.

Posted: Mon Aug 04, 2003 11:44 am
by ayron
Stoker's right, the css file doesn't seem to exist - certainly not where it's being referenced

Posted: Mon Aug 04, 2003 10:48 pm
by Avalon
*smack to the forehead* :oops:

It's usually something really simple isn't it? That's what I get for programming/uploading after midnight. I swear, I'm usually more with it than that. Sorry if I wasted anyone's time.