Jeg har den her opgaver jeg skal have lavet. Men på nogle af min sider vil den ikke vise min baggrund, mens den på de andre sider viser baggrund fint nok.
Her er hvor det hele bliver include.
<div id="outer_content">
<div id="inner_content">
<?
if($target == "ommig" or $target == "") {
include 'menu/ommig.php';
}
if($target == "mitcv") {
include 'menu/mitcv.php';
}
if($target == "opgaver") {
include 'menu/opgaver.php';
}
if($target == "link") {
include 'menu/link.php';
}
if($target == "kontakt") {
include 'menu/kontakt.php';
}
?>
</div>
</div>
Her den en af de 2 sider der virker:
<?
include('login/connect.php');
?>
<div id="left">
<?
if($utarget == "") {
?>
<ul>
<li>
<?
$sql = "SELECT * FROM portfolio_opgaver ";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$id = $row['id'];
$navn = $row['navn'];
$text = $row['text'];
$pic = $row['pic'];
?>
<a href="?t=opgaver&ut=<? echo $id ?>"><? echo $navn ?></a>
<?
}
?>
</li>
</ul>
<?
}
if(!$utarget == "") {
$sql = "SELECT * FROM portfolio_opgaver WHERE id = '$utarget'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$navn = $row['navn'];
$text = $row['text'];
$pic = $row['pic'];
?>
<h1><? echo $navn; ?></h1>
<p><? echo $text; ?></p>
</div>
<div id="right">
<img src="pic/opgaver/<? echo $pic; ?>">
</div>
<?
}
}
?>
Her er en af de 3 sider der IKKE virker:
<?
include('login/connect.php');
?>
<div id="left">
<?
if($utarget == "") {
$sql = "SELECT * FROM portfolio_ommig";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$h1 = $row['h1'];
$h2 = $row['h2'];
$text = $row['text'];
$pic = $row['pic'];
?>
<h1><? echo $h1; ?></h1>
<h2><? echo $h2; ?></h2>
<p><? echo nl2br($text); ?></p>
</div>
<div id="right">
<img src="pic/<? echo $pic; ?>.png" alt="<? echo $pic; ?>">
</div>
<?
}
}
?>
Og her er CSS for det hele:
*{
padding:0px;
margin:0px auto;
font-family:Verdana;
}
body{
background-image: url("pic/index/background.jpg");
background-repeat: no-repeat;
background-position: top center;
background-color: #31b7b8;
}
#container{
width:718px;
}
#header {
background-image: url("pic/index/top.png");
background-repeat: no-repeat;
height:64px;
width:709px;
position:relative;
top:100px;
z-index:3;
}
#header h1 {
padding:10px;
float:left;
}
#header form {
float:right;
margin-right:25px;
}
#header input {
font-size:10px;
}
#header p {
font-size:12px;
}
#top{
background-image: url("pic/index/header.png");
height:318px;
width:674px;
position:relative;
top:104px;
z-index:2;
font-variant:small-caps;
}
#top ul{
list-style-type:none;
padding-top:30px;
padding-left:20px;
}
#top li{
}
#top a{
display:block;
padding:12px;
text-decoration:none;
color:#040404;
font-size:12pt;
}
#outer_content{
background-image: url("pic/index/inner_content.png");
background-repeat:repeat-y;
position:relative;
top:-75px;
z-index:1;
clear:both;
}
#inner_content {
padding-top:175px;
display:block;
}
#bottom{
background-image: url("pic/index/bottom_content.png");
height:24px;
width:718px;
position:relative;
bottom:-23px;
clear:both;
z-index:1;
}
/* Menu */
#left {
float:left;
width:48%;
margin-left:20px;
}
#left h1 {
font-size:16px;
}
#left h2 {
font-size:14px;
}
#left p {
font-size:14px;
padding-top:20px;
padding-left:20px;
padding-right:20px;
}
#left ul {
list-style-type:none;
margin-left:25px;
margin-top:25px;
}
#left a {
text-decoration:none;
display:block;
}
#right {
float:left;
width:40%;
}
#right img {
max-height:250px;
max-width:300px;
float:left;
}