<?php if(isset($_GET['action']) && $_GET['action']=='create'){ $con = mysql_connect("localhost","habber_dk","bZZUmawp");
if (!$con){ die(mysql_error()); }
mysql_select_db("habber_dk", $con);
$tekst = mysql_real_escape_string(nl2br(htmlentities($_POST['newsText'])));
$overskrift = mysql_real_escape_string(htmlentities($_POST['heading']));
$date = date("Y-m-d");
mysql_query("INSERT INTO `chat` (`nyhedsID`, `navn`, `tag`, `dato`) VALUES ('NULL', '$overskrift', ' $tekst', '$date')") or die(mysql_error()); } ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Når du keder dig lidt for meget</title>
<meta content="Evrsoft First Page" name="GENERATOR">
<style type="text/css">
P { COLOR: #000000}H2 { COLOR: #252829}B { COLOR: #252829}HR { }I { COLOR: #818f94}
</style>
</head>
<body style="BACKGROUND: #1a1a1a">
<center>
<br>
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="BACKGROUND-IMAGE: url(habberbannerv.png)" width="293" height="142"></td>
<td style="BACKGROUND-IMAGE: url(habberbannerh.png)" width="357" height="142">
<table align="middle" valign="middle">
<tbody>
<tr>
<td valign="center" align="middle" width="300" height="130">Her vil der komme en reklame så jeg ken tjæne lidt penge</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="BACKGROUND-IMAGE: url(midt.png)" valign="center" align="middle" width="644" colspan="2" height="100%">
<?php include ('menu.php'); ?>
<hr>
<p>velkommen til joke siden på habber.dk. her på siden kan du skrive dine egen jokes, og læse andres.<br>
<b style="COLOR: #ff2405">OBS! <i style="COLOR: #ff2405">Siden er stadig under opbygning</i></b></p>
<hr><iframe tyle="width:100px; height:150px" >
<?php mysql_connect("localhost","","") or die(mysql_error());
mysql_select_db("habber_dk") or die(mysql_error());
$result = mysql_query("SELECT * FROM chat ORDER BY nyhedsID DESC") or die(mysql_error());
while($row = mysql_fetch_array($result)) {
?>
<b><?php
echo $row["navn"];
?></b>
<p><?php
echo $row["besked"];?></p>
<hr>
Skrevet af:
<?php
echo $row["forfatter"];
?>--
<?php echo $row["dato"]; ?>
<hr>
<?php }
?></iframe>
</td>
</tr>
<tr>
<td style="BACKGROUND-IMAGE: url(midt.png)" valign="center" align="middle" width="644" colspan="2" height="100%">
<form id="newsForm" name="newsForm" action="tag.php?action=create" method="post">
<table cellpadding="2" width="500" border="0">
<tbody>
<tr>
<td>Navn:</td>
<td><input id="heading" name="heading"></td>
</tr>
<tr>
<td>Din Besked:</td>
<td>
<textarea id="newsText" name="newsText" rows="5" cols="45">
</textarea></td>
</tr>
<tr>
<td> </td>
<td><input id="submitBtn" type="submit" value="Send Besked" name="submitBtn"></td>
</tr>
</tbody>
</table>
</form>
</td>
</tr>
<tr>
<td style="BACKGROUND-IMAGE: url(http://www.habber.dk/bund.png)" valign="center" align="middle" width="644" colspan="2" height="22"><i>©2009 Habber.dk All rights reserved.</i></td>
</tr>
</tbody>
</table>
</center>
</body>
</html>
ja, jeg har lidt problemer med den her kode.. database delen virker fint.. men mangler at teksten kommer frem i iframe boxen... kan du hjælpe ming?;D (det er en chat/tagwall til min hjemmeside)