Previous Thread
Next Thread
Print Thread
Rate Thread
#284232 03/13/2005 12:53 AM
Joined: Nov 2002
Posts: 554
Code Monkey
Code Monkey
Offline
Joined: Nov 2002
Posts: 554
My CSS is in the infant stages of learning and I have a few questions. I am trying to implement light tables and dark tables in a PHP tool I am developing for server ops but I am having a hard time. Are these tags only used in Threads? I did a search on the net and all links point here.

How would I get this to use a lighttable
Code
 echo "<tr>";<br />echo "<td>$uname </td>";<br />echo "<td>$fname</td>";<br />echo "<td>$lname</td>";<br />echo "<td>$emailadd</td>";<br />echo "<td>$redirect</td>";<br />echo "<td>$auth</td>";<br />echo "</tr>";<br /> 

while adding this to the stylesheet
Code
 .lighttable {<br /> background-color: #4A4848;<br /> font-family: Tahoma; <br />font-size : 12px; <br />color: #D3D3D3<br />} 
Mind you this is is all outside of Threads as I want to get it working before I integrate it. Currently the stylesheet is called bloodymess.css

Sponsored Links
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay well first off does the header call the stylesheet if not in your header you must add this line

<link rel="stylesheet" href="http://yoururl/to/your/stylesheets/bloodymess.css" type="text/css" />

between your head tags

secondly once its being used then simply in the td tags

echo "<td>$uname </td>";

change to

echo "<td class = "lighttable">$uname </td>";

Joined: Nov 2002
Posts: 554
Code Monkey
Code Monkey
Offline
Joined: Nov 2002
Posts: 554
Thanks Scroungr that was the simple fix I needed.I allready had the stylesheet links. It kinda threw me though with having it at the bottom of the php script though. I assume php has to parse first? with html at top it gave me errors
Code
<?php<br /><br />//prevents caching<br />header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");<br />header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");<br />header("Cache-Control: post-check=0, pre-check=0",false);<br />session_cache_limiter();<br /><br />session_start();<br /><br />//verifies that the username and password have been stored in the session variables<br />if (($_SESSION[username] != "username") && (ucfirst($_SESSION[authority]) != "Administrator"))<br /><br />{<br />//if session variables have not been set, redirect to errorlogin.html<br />header("Location: ../loginredir/errorlogin.html");<br />exit;<br />}<br /><br />//require the config file<br />require ("../config.php");<br />//require<br />//make the connection to the database<br />$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());<br />$db = @mysql_select_db($db_name,$connection)or die(mysql_error());<br /><br />//build and issue the query<br />$sql ="SELECT * FROM $table_name";<br />$result = @mysql_query($sql,$connection) or die(mysql_error());<br /><br />//get the number of rows in the result set<br />$num = mysql_num_rows($result);<br /><br />//prints a table of the information in the database<br />if ($num != 0) {<br />echo "<table border=\"1\" width=\"100%\" id=\"table1\" bordercolorlight=\"#fc0000\" bordercolordark=\"#fc0000\">";<br />echo "<tr>";<br />echo "<td width=\"10%\"class=\"darktable\">Username:</td>";<br />echo "<td width=\"10%\"class=\"darktable\">First Name:</td>";<br />echo "<td width=\"10%\"class=\"darktable\">Last Name:</td>";<br />echo "<td width=\"20%\"class=\"darktable\">E-mail:</td>";<br />//echo "<td width=\"20%\"class=\"darktable\">Redirect to:</td>";<br />echo "<td width=\"20%\"class=\"darktable\">Authority:</td>";<br />echo "</tr>";<br /><br /><br />$redir ="SELECT * FROM $table_name";<br />	while ($redir = mysql_fetch_object($result)) <br />{<br />	<br />$fname = $redir -> firstname;<br />$lname = $redir -> lastname;<br />$uname = $redir -> username;<br />$emailadd = $redir -> email;<br />$emailpass = $redir -> epass;<br />$ealert = $redir -> alert;<br />$last = $redir -> lastlogin;<br />$redirect = $redir -> redirect;<br />$auth = $redir -> authority;<br /><br />	<br />echo "<tr>";<br />echo "<td class = \"lighttable\">$uname </td>";<br />echo "<td class = \"lighttable\">$fname</td>";<br />echo "<td class = \"lighttable\">$lname</td>";<br />echo "<td class = \"lighttable\">$emailadd</td>";<br />//echo "<td class = \"lighttable\">$redirect</td>";<br />echo "<td class = \"lighttable\">$auth</td>";<br />echo "</tr>";<br /><br /><br />} <br />echo "</table>";<br />}<br /><br /><br />?><br /><br /><html><br /><br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><br /><title>Admin List</title><br /><br /><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br /><html dir="ltr"><br /><head><br /><link rel=StyleSheet type="text/css" media="screen" href="{TEMPLATEDIR}/style.css"><br /><link rel=StyleSheet type="text/css" media="screen" href="../../themes/default/style.css"><br /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br /><meta http-equiv="Content-Style-Type" content="text/css"><br /><TITLE>Admin List</TITLE><br /><br /></head><br /><br /><body><br /><br /></body><br /><br /></html><br /><br /><br />  
Now the difficult part will be implementing md5 for the login cookies. Any helpfull tutorials you know?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
put the

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Admin List</title>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="ltr">
<head>
<link rel=StyleSheet type="text/css" media="screen" href="{TEMPLATEDIR}/style.css">
<link rel=StyleSheet type="text/css" media="screen" href="../../themes/default/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<TITLE>Admin List</TITLE>

</head>

<body>

before the <?

and below the ?>

put the closing tags

</body>

</html>

Joined: Nov 2002
Posts: 554
Code Monkey
Code Monkey
Offline
Joined: Nov 2002
Posts: 554
I tried that but it caused

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php:12) in /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php on line 22

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php:12) in /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php:12) in /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php on line 24

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php:12) in /usr/www/efs/server/toolbox/phprcon/loginredir/admin/dblist.php on line 27


from

//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();

Last edited by ChAoS; 03/13/2005 1:41 AM.
Sponsored Links
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
your right I see your already calling header() function.. my bad..

try this instead

under
header("Cache-Control: post-check=0, pre-check=0",false);

$header="<link rel="stylesheet" href="http://yoururl/to/your/stylesheets/bloodymess.css" type="text/css" />";
try header($header);

you can also rewrite your header function a little and put it all into a $header value then call that $header in header();

Joined: Nov 2002
Posts: 554
Code Monkey
Code Monkey
Offline
Joined: Nov 2002
Posts: 554
Oh that's beauty- you get the Code Warrior award on my credits page
Thankyou


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)