Hello All,
I've got a problem with php causing the colours in my css boxes to show incorrectly. The box is meant to be blue throughout with a gradient of colour (darker at the top to light at the bottom. But across the box at some point you've got a horizontal line, after which it's just red.
I think it's to do with the coding within the php headers, can someone have a look?
It may also be the case that a better/more suitable DTD should be used.
The CSS code seems to be W3C compliant
html:
<?PHP
session_start();
//Check whether the session variable SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID'])) {
header("location: frontpagesite.html");
exit();
}
$theid=($_SESSION['SESS_MEMBER_ID']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ZnajdeJęzyk.pl - Teachers! Edit your profile</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="css/final.css" />
</head>
<body onload="fillCategory();">
<div id="centerColumn">
<div id="header">
<img src="images/header.jpg" alt="" class="float_left"/>
</div>
<!-- End Header -->
<div class="roundedcornr_box_blue">
<div class="roundedcornr_top_blue"><div></div></div>
<div class="roundedcornr_content_blue">
<h2>Teachers! You can edit your profile details here</h2>
</div>
<div class="roundedcornr_bottom_blue"><div></div></div>
</div>
<div class="roundedcornr_box_blue">
<div class="roundedcornr_top_blue"><div></div></div>
<div class="roundedcornr_content_blue">
<form method="POST" action="teacherdetailsupdate.php">
<?PHP
require_once(dirname(__FILE__) . "/Databaseconn.php");
// Quote variable to make safe
function quote_smart($value)
{
// Stripslashes
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
// Quote if not integer
if (!is_numeric($value)) {
$value = "'" . mysql_real_escape_string($value) . "'";
}
return $value;
}
// levels they teach
$query = "SELECT teacherlevel.TeacherID,teacherlevel.TeacherLevel
From teacherlevel
WHERE teacherlevel.TeacherID='$theid'";
$result = mysql_query($query) or die(mysql_error());
print ("<h3>The level(<img src="http://csscreator.com/sites/all/modules/smileys/packs/Roving/drunk.png" title="Drunk" alt="Drunk" class="smiley-content" /> of student you teach:</h3>");
while($row = mysql_fetch_array($result))
{
//echo "<td><h3>" . $row['TeacherLevel'] . "</h3></td>";
if ($row['TeacherLevel']=="beginner")
{
$tut2="beginner" AND $tl1="1";
}
Elseif ($row['TeacherLevel']=="intermediate")
{
$tut2="intermediate" AND $tl2="1";
}
elseif ($row['TeacherLevel']=="advanced")
{
$tut2="Advanced" AND $tl3="1";
}
}
?>
<table width="100%">
<form method=post action=teacherlevelupdate.php>
<tr>
<td width="25%"><input type="checkbox" name=level[] value="beginner" <?PHP if($tl1=="1"){print " checked=\"checked\"";} ?>>beginner</td>
<td width="25%"><input type="checkbox" name=level[] value="intermediate" <?PHP if($tl2=="1"){print " checked=\"checked\"";} ?>>intermediate</td>
<td width="25%"><input type="checkbox" name=level[] value="advanced" <?PHP if($tl3=="1"){ print " checked=\"checked\"";} ?>>advanced</td>
<td width="25%"><input type="Submit" value="Edit Level"></td>
</tr>
</form>
</table>
</div>
<div class="roundedcornr_bottom_blue"><div></div></div>
</div>
<div class="roundedcornr_box_blue">
<div class="roundedcornr_top_blue"><div></div></div>
<div class="roundedcornr_content_blue">
<?PHP
// price range
$query = "SELECT teacherprice.TeacherID,teacherprice.Price
From teacherprice
WHERE teacherprice.TeacherID='$theid'";
$result = mysql_query($query) or die(mysql_error());
print ("<h3>The price(<img src="http://csscreator.com/sites/all/modules/smileys/packs/Roving/drunk.png" title="Drunk" alt="Drunk" class="smiley-content" /> you charge per hour (60 min):</h3>");
while($row = mysql_fetch_array($result))
{
if ($row['Price']=="0-20zl")
{
$pr1="1";
}
elseif ($row['Price']=="21-40zl")
{
$pr2="1";
}
elseif ($row['Price']=="41-60zl")
{
$pr3="1";
}
elseif ($row['Price']=="61-80zl")
{
$pr4="1";
}
elseif ($row['Price']=="81-100zl")
{
$pr5="1";
}
elseif ($row['Price']=="100zl")
{
$pr6="1";
}
}
?>
<table width="100%">
<tr>
<form method=post action=teacherpriceupdate.php>
<td width="14%"><input type="checkbox" name="Price[]" value="0-20zl" <?PHP if($pr1=="1"){ print " checked=\"checked\"";} ?> /> 0-20zl</td>
<td width="14%"><input type="checkbox" name="Price[]" value="21-40zl" <?PHP if($pr2=="1"){ print " checked=\"checked\"";} ?>/> 21-40zl</td>
<td width="14%"><input type="checkbox" name="Price[]" value="41-60zl" <?PHP if($pr3=="1"){ print " checked=\"checked\"";} ?>/> 41-60zl</td>
<td width="14%"><input type="checkbox" name="Price[]" value="61-80zl" <?PHP if($pr4=="1"){ print " checked=\"checked\"";} ?>/> 61-80zl</td>
<td width="14%"><input type="checkbox" name="Price[]" value="81-100zl" <?PHP if($pr5=="1"){ print " checked=\"checked\"";} ?>/> 81-100zl</td>
<td width="14%"><input type="checkbox" name="Price[]" value="100zl" <?PHP if($pr6=="1"){ print " checked=\"checked\"";} ?>/> 100zl+</td>
<td width="14%"><input type=Submit value="Edit Prices"></td>
</tr>
</form>
</table>
</div>
<div class="roundedcornr_bottom_blue"><div></div></div>
</div>
<!-- Begin Footer -->
<div id="footer" align="center">
<p><a href=".html">Contact ZnajdeJęzyk.pl</a> | <a href=".html">Regulations</a> | <a href=".html">Links</a> | <a href=".html">Site Map</a>
<br />
Copyright © All Rights Reserved 2010 - English Language Solutions
<br />
English Language Solutions, ul. Plocka 45/37, 01-152, Warsaw, Poland | Tel. - (0048) 793 577 240</p>
</div>
<!-- End Footer -->
</div>
<!--//end #centerColumn//-->
</body>
</html>
css side
body {
margin:0;
padding:0;
height:100%;
background-color:#FBFBEF;
color:#000000;
text-align:center;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
a {
color:#cc0000;
text-decoration:underline;
}
a:hover {
color:#616161;
text-decoration:none;
}
td.desc {
padding:4px;
text-align:left;
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
}
#centerColumn {
margin:0 auto;
width:800px;
text-align: left;
background-color:#FBFBEF;
}
/* black header text */
#centerColumn h1 {
margin:0 0 0 10px;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:1.5em;
color:#000000;
}
/* white header text */
#centerColumn h2 {
margin:0 0 0 10px;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:1.5em;
color:#ffffff;
}
/* white body text */
#centerColumn h3 {
margin:0 0 0 3px;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:1.1em;
color:#ffffff;
}
/* blue body text */
#centerColumn h4 {
margin:0 0 0 3px;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:1.1em;
color:#3E93F0;
}
/* black body text */
#centerColumn h5 {
margin:0 0 0 3px;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:1.1em;
color:#000000;
}
#header {
margin: 0 0 0 -9px;
height:177px;
width:800px;
}
.floatleft { float: left; }
.floatright { float: right; }
.roundedcornr_box_blue {
margin: 5px 0 0 0;
width: 800px;
clear: both;
background: #d80d0d url(../images/roundedcornr_381336_grad.gif) repeat-x top left;
}
.roundedcornr_top_blue div {
background: url(../images/roundedcornr_381336_tl.gif) no-repeat top left;
}
.roundedcornr_top_blue {
background: transparent url(../images/roundedcornr_381336_tr.gif) no-repeat top right;
}
.roundedcornr_bottom_blue div {
background: url(../images/roundedcornr_381336_bl.gif) no-repeat bottom left;
}
.roundedcornr_bottom_blue {
background: transparent url(../images/roundedcornr_381336_br.gif) no-repeat bottom right;
}
.roundedcornr_top_blue div, .roundedcornr_top_blue,
.roundedcornr_bottom_blue div, .roundedcornr_bottom_blue {
width: 100%;
height: 10px;
font-size: 1px;
}
.roundedcornr_content_blue { margin: 0 10px; }
#footer {
width: 800px;
position:relative;
clear:both;
bottom:0;
margin:10px 0 0 0;
padding:0;
height:4em;
line-height:1.5em;
text-align:center;
font-size:.7em;
background-color:#ffffff;
}
Many thanks in advance