Tjobbe
November 30th, 2004, 18:56
probably me being tired but I'm trying to include a style sheet on:
http://www.bagnboxman.co.uk/login/display.php
I can include it no problem, but it only seems to change the font size for the "There are x records." text at the top but not for the rest.
I'm using:
echo "<style type='text/css' media='all'>@import 'displaystyle.css';> </style>";
to include the style sheet, I have also used the:
<link href="displaystyle.css" rel="stylesheet" type="text/css">
code in the head part of the file with the same effect.
heres the php file
<html>
<head><title>Database of registerred members</title>
</head>
<body>
<?php
echo "<style type='text/css' media='all'>@import 'displaystyle.css';> </style>";
$db="bagnboxm_userlist";
$link = mysql_connect('localhost', 'bagnboxm_login', 'login');
if (! $link) die("Couldn't connect to MySQL");
mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error());
$result = mysql_query( "SELECT * FROM users" ) or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
echo "There are $num_rows records.<P>";
echo "\t<table width='100%' border='0' cellpadding='4' cellspacing='1' bgcolor='#000000'>
<tr bgcolor='#E9E9E9'>
<td>Username</td>
<td>First Name </td>
<td>Last Name </td>
<td bgcolor='#CCCCCC'>Email</td>
<td>Phone Number </td>
<td>Address 1 </td>
<td>Address2</td>
<td>Postcode</td>
<td>County</td>
</tr>
\n<tr>\n
";
while ($row = mysql_fetch_object($result)){
echo "\t<td bgcolor='#FFFFFF'>$row->name</td><td bgcolor='#FFFFFF'>$row->firstname</td><td bgcolor='#FFFFFF'>$row->lastname</td><td bgcolor='#FFFFFF'><a href=mailto:".$row->email.">Click To Email</a></td><td bgcolor='#FFFFFF'>$row->tel</td><td bgcolor='#FFFFFF'>$row->address1</td><td bgcolor='#FFFFFF'>$row->address2</td><td bgcolor='#FFFFFF'>$row->pcode</td><td bgcolor='#FFFFFF'>$row->county</td>\n</tr>\n";
}
echo "</table>\n";
mysql_close($link);
?>
</body>
</html>
and heres the stylesheet file
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 75%;
color: #000000;
}
a:link, a:active, a:visited {
color: #FFFFFF;
text-decoration: underline;
background-color: #333333;
display:block;
}
a:hover {
color: #333333;
text-decoration: none;
background-color: #FFFFFF;
display:block;
}
am I including the stylesheet wrong or do i HAVE to create a new style to get it to show in the table?
Thanks in advance.
http://www.bagnboxman.co.uk/login/display.php
I can include it no problem, but it only seems to change the font size for the "There are x records." text at the top but not for the rest.
I'm using:
echo "<style type='text/css' media='all'>@import 'displaystyle.css';> </style>";
to include the style sheet, I have also used the:
<link href="displaystyle.css" rel="stylesheet" type="text/css">
code in the head part of the file with the same effect.
heres the php file
<html>
<head><title>Database of registerred members</title>
</head>
<body>
<?php
echo "<style type='text/css' media='all'>@import 'displaystyle.css';> </style>";
$db="bagnboxm_userlist";
$link = mysql_connect('localhost', 'bagnboxm_login', 'login');
if (! $link) die("Couldn't connect to MySQL");
mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error());
$result = mysql_query( "SELECT * FROM users" ) or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
echo "There are $num_rows records.<P>";
echo "\t<table width='100%' border='0' cellpadding='4' cellspacing='1' bgcolor='#000000'>
<tr bgcolor='#E9E9E9'>
<td>Username</td>
<td>First Name </td>
<td>Last Name </td>
<td bgcolor='#CCCCCC'>Email</td>
<td>Phone Number </td>
<td>Address 1 </td>
<td>Address2</td>
<td>Postcode</td>
<td>County</td>
</tr>
\n<tr>\n
";
while ($row = mysql_fetch_object($result)){
echo "\t<td bgcolor='#FFFFFF'>$row->name</td><td bgcolor='#FFFFFF'>$row->firstname</td><td bgcolor='#FFFFFF'>$row->lastname</td><td bgcolor='#FFFFFF'><a href=mailto:".$row->email.">Click To Email</a></td><td bgcolor='#FFFFFF'>$row->tel</td><td bgcolor='#FFFFFF'>$row->address1</td><td bgcolor='#FFFFFF'>$row->address2</td><td bgcolor='#FFFFFF'>$row->pcode</td><td bgcolor='#FFFFFF'>$row->county</td>\n</tr>\n";
}
echo "</table>\n";
mysql_close($link);
?>
</body>
</html>
and heres the stylesheet file
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 75%;
color: #000000;
}
a:link, a:active, a:visited {
color: #FFFFFF;
text-decoration: underline;
background-color: #333333;
display:block;
}
a:hover {
color: #333333;
text-decoration: none;
background-color: #FFFFFF;
display:block;
}
am I including the stylesheet wrong or do i HAVE to create a new style to get it to show in the table?
Thanks in advance.