PDA

View Full Version : My CSS Won't Work On This Page


tomyknoker
04-04-2007, 01:14 PM
Can anyone see why my htm and css won't work on this page? I have done like 10 pages in a row fine and this one just ignores the stylesheet entirely...


<?php

if(empty($_SESSION['session_started']))
{
session_cache_expire(120);
session_start();
$_SESSION['session_started'] = "TRUE";
}

/* connect to the mysql database and use different queries for the count of members */

include 'library/config.php';
include 'library/opendb.php';

$info = mysql_query("SELECT * from `tblrepresentatives`");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>Members Status</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="cs_style.css" rel="stylesheet" type="text/css" />
<body>
<div id="wrap">
<div id="header"><p>Hello <? echo $_SESSION['txtUserId']; ?>! You are now Logged in.<a href="index.php">Logout</a></p></div>
<div id="nav"><?php include("nav.php"); ?></div>
<div id="main">
<p><img src="images/membership_status.png" alt="Membership Status"></p>
<div id="container">
<?php

echo '<table width="700" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th scope="col" class="twenty">FIRST NAME</th>
<th scope="col" class="twenty">LAST NAME</th>
<th scope="col" class="twenty">MEMBERS</th>
<th scope="col" class="twenty">EDIT</th>
<th scope="col" class="twenty">&nbsp;</th>
</tr>
</thead>';

//now check it for failure and display a decent error message if it did fail
if (!$info) {
die("Query failed. Query text: $query<br />Error Message: ".mysql_error());
}

else {
while ($qry = mysql_fetch_array($info)) {
$i++;

$rep = $qry['rep_NBR'];

$members = mysql_query("SELECT * FROM `tblmembers` WHERE `rep_NBR`='$rep'");

$total_members = mysql_num_rows($members);

//create the layout
?>

<tr valign="top" class="<?php echo $i % 2 ? 'odd' : 'even'; ?>">
<td><?php echo $qry['rep_Firstname']; ?></td>
<td><?php echo $qry['rep_Lastname']; ?></td>
<td><a href="showRepMembers.php?rep_id=<?=$qry['rep_NBR'];?>"><?=$total_members;?></a></td>
<td><a href="showRepEdit.php?rep_id=<?php echo $qry['rep_NBR']; ?>">Edit</a></td>
<td>Delete</td>
</tr>
<?php
}
}

echo '</table></div>
</div>
<div id="footer">
<p>Footer</p>
</div>
</body>
</html>';

include 'library/closedb.php';

?>

erisco
04-04-2007, 02:04 PM
For starters, PHP has absolutely zero influence on this unless it is dynamically creating the style sheet link, or it is dynamically creating the CSS.

Check that your paths are valid and that the html and css source is showing up properly.

scoutt
04-08-2007, 10:55 AM
but it is erisco. did you see this line

class="<?php echo $i % 2 ? 'odd' : 'even'; ?>">

tomyknoker, what is the final outcome of the script? does it have a class there? can we see? if that line produces odd or even then yes, eirsco is correct, but if it produces nothing than the code is wrong.

Horus_Kol
04-08-2007, 07:55 PM
I've always had issues with css and <tr> tags - maybe its something to do with that?

erisco
04-09-2007, 09:26 AM
Did ya read this scoutt?
unless it is dynamically creating the style sheet link, or it is dynamically creating the CSS.