CSS not working with PHP script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Avalon
Forum Newbie
Posts: 2
Joined: Mon Aug 04, 2003 10:42 am
Location: Canada

CSS not working with PHP script

Post 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
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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..
Last edited by Stoker on Mon Aug 04, 2003 11:43 am, edited 1 time in total.
Telos
Forum Commoner
Posts: 37
Joined: Sat Aug 02, 2003 9:03 am
Location: Finland

Post by Telos »

Try include instead of require....Don't know if there's any difference but worth to try.
ayron
Forum Newbie
Posts: 14
Joined: Tue Jun 03, 2003 11:18 pm
Location: Perth, Australia

Post by ayron »

Stoker's right, the css file doesn't seem to exist - certainly not where it's being referenced
Avalon
Forum Newbie
Posts: 2
Joined: Mon Aug 04, 2003 10:42 am
Location: Canada

Post 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.
Post Reply