<?php
$conn = mysqli_connect("localhost","root","","portfolio");
?>
<!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"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Portfolio - Smart Graphic</title>
<link href="../stylesheet/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table align="center" id="maintop" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<!---------------------------------------------------------------------------------------------------------------Top start----------------------------------------------------------------------------------------------------------->
<table id="top" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="spalte1top"></td>
<td id="logo">
<?php
$logo = "logo";
$billededir = '../billeder/';
$query = mysqli_query($conn,"select * from image where id = '".$logo."'");
while($result = mysqli_fetch_array($query)){
echo "<img src='".$billededir.$result['billede']."' />";
};
?>
</td>
<td id="grafik">
<?php
$abe = "overskrift";
$get1 = mysqli_query($conn,"select * from tekst where id = '".$abe."'");
while($result = mysqli_fetch_array($get1)){
echo "<div id='font_grafik'>".$result['tekst1']."</div>";
};
?>
</td>
<td id="link_top" align="right" valign="bottom">
<?php
$rs = mysqli_query($conn,"select * from topmenu");
while($link = mysqli_fetch_array($rs)){
echo "<a id='topmenu' href='index.php?pageid=".$link['id']."'>".$link['navn']." </a>";
};
?>
</td>
<td id="spalte2top"></td>
</tr>
</table>
<!-------------------------------------------------------------------------------------------------------------Slut-------------------------------------------------------------------------------------------------------------------->
<!---------------------------------------------------------------------------------------------------------Menu start--------------------------------------------------------------------------------------------------------------->
<table border="0" cellpadding="0" cellspacing="0" id="menu_top">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
<table align="center" id="mainbund" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id='spalte1'></td>
<td valign="top" align="center">
<?php
if($_GET['pageid'] == 2){
?>
<form action="index.php?pageid=2" method="post" enctype="multipart/form-data">
<input type="file" name="billede" size="20">
<input type="submit" name="submit" value="Upload" />
</form>
<?php
//Har vi et billede?
$uploadDir = getcwd() . '/galleri/';
if($_FILES['billede']['size'] > 0)
{
move_uploaded_file($_FILES['billede']['tmp_name'],$uploadDir . $_FILES['billede']['name']);
}
mysql_query ("INSERT INTO tekst (billede) values ('".$_FILES['billede']['name']."')") or die(mysql_error());
exit();
};
?>
</td>
<td id='spalte4'></td>
</tr>
</table>
<!-------------------------------------------------------------------------------------------------------------Slut-------------------------------------------------------------------------------------------------------------------->
</body>
</html>