Jeg har prøvet alt intet vil virke :
her er min kode:
<?php
session_start();
if($_SESSION['tjek'] != 1){
header("location: login.php");
}
include($_SERVER['DOCUMENT_ROOT']."/connections/db.php");
$tekst = str_replace("\n", "<br>", $_POST['brodtekst']);
$overskrift = $_POST['overskrift'];
//$tekst = $_POST['brodtekst'];
$hentdata = mysql_query("SELECT * FROM profil");
$visdata = mysql_fetch_array($hentdata);
//vælger database og tabel
if (isset($_POST['Submit'])){
mysql_query("UPDATE profil SET overskrift='$overskrift', brodtekst='$tekst' WHERE id=1");
header("location: home.php");
}
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link href="
file:///C|/Documents and Settings/Linda Tjørndal/My Documents/BIRGIT/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="605" height="520" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="left" valign="top" bgcolor="#E2E3E7"><form name="form1" method="post" action="">
<table width="605" height="378" border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top" bgcolor="#808694">
<td width="18" height="19" bgcolor="#E2E3E7"> </td>
<td colspan="3" class="AdminSideOverskrift">Profil rediger/ret</td>
<td width="18"> </td>
<td width="27"> </td>
</tr>
<tr align="left" valign="top" bgcolor="#808694">
<td width="18" height="19" bgcolor="#E2E3E7"> </td>
<td height="19" colspan="3" bgcolor="#E2E3E7" class="AdminSideOverskrift">
</td>
<td width="18" bgcolor="#E2E3E7"> </td>
<td width="27" bgcolor="#E2E3E7"> </td>
</tr>
<tr align="left" valign="top">
<td height="35"> </td>
<td width="93" class="overskrift">Overskrift:</td>
<td width="449" height="35" colspan="2"><input name="overskrift" type="text" id="overskrift" value=<?php echo $visdata['overskrift']; ?>></td>
<td> </td>
<td> </td>
</tr>
<tr align="left" valign="top">
<td height="182"> </td>
<td class="overskrift">Tekst:</td>
<td height="182" colspan="2"><textarea name="brodtekst" cols="50" rows="10" id="brodtekst"><?php echo $txt = str_replace("<br>","\n", $visdata['brodtekst']); ?></textarea></td>
<td> </td>
<td> </td>
</tr>
<tr align="left" valign="top">
<td height="39"> </td>
<td> </td>
<td height="39" colspan="2"><input type="submit" name="Submit" value="Gem"></td>
<td> </td>
<td> </td>
</tr>
<tr align="left" valign="top">
<td height="30"> </td>
<td>
</td>
<td height="30" colspan="2" class="fejl"><?php
if(isset($_POST['Submit']))
{
if(empty($overskrift)){
echo "*FEJL: Du mangler at skrive en overskrift";
}else{
echo "";
}
}
?>
</td>
<td> </td>
<td> </td>
</tr>
<tr align="left" valign="top">
<td height="30"> </td>
<td> </td>
<td height="30" colspan="2" class="fejl"><?php
if(isset($_POST['Submit']))
{
if(empty($tekst)){
echo "*FEJL: Du skal skrive en tekst";
}else{
echo "";
}
}
?></td>
<td> </td>
<td> </td>
</tr>
<tr align="left" valign="top">
<td height="24"> </td>
<td> </td>
<td height="24" colspan="2"><span class="fejl">
</span></td>
<td> </td>
<td> </td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>