nu har jeg prøvet en masse .. men jeg kan ikke få det tilat virke... den skrive bare en masse 0000 ... ?
så i får lige siderne, så kan i se om i kan finde fejlen
tagwall:
<form action="<? echo $php_self ?>">
<table border="0"">
<tr>
<td><h2>Navn:</td>
<td width="50"></td>
<td><input type="text" name="navn"></td>
</tr>
<tr>
<td><h2>Mail:</td>
<td width="50"></td>
<td><input type="text" name="mail"></td>
</tr>
<tr>
<td><h2>Website:</td>
<td width="50"></td>
<td><input type="text" name="website" value="http://"></td>
</tr>
<tr>
<td><h2>Overskrift:</td>
<td width="50"></td>
<td><input type="text" name="overskrift"></td>
</tr>
<tr>
<td valign="top"><h2>Tekst:</td>
<td width="50"></td>
<td><TEXTAREA type="text" name="tekst" rows="8" cols="25"></textarea></td>
</tr>
</table>
<br><br>
<center>
<input type="submit" name="add_tag" value="Skriv">
</center>
</form>
<?
if($add_tag) {
mysql_connect("******","*****","******");
mysql_select_db("******");
$query = mysql_query("INSERT INTO tagwall SET navn = '$navn', mail = '$mail', overskrift = '$overskrift', tekst = '$tekst', website = '$website', time = '$time', ip = '$ip'");
echo "<center><a href=\\"tagwall2.php\\">Se dit tag</a></center>";
}
$ip = getenv("REMOTE_ADDR");
$fra = getenv("HTTP_REFERER");
$FIP = $GLOBALS['HTTP_X_FORWARDED_FOR'];
if (($FIP != "") && ($FIP != "Unknown"))
{
$IP = $FIP;
}
$IP = explode(",", $IP);
$ip = $IP[0];
$time = time("l \\\\t\\h\\e jS", $time);
$browser = getenv("HTTP_USER_AGENT");
?>
tagwall2:
<?PHP
$connection = mysql_connect("******","******","******") or die("Couldn't connect to databaseserver");
mysql_select_db("******", $connection) or die("Couldn't connect to database");
$query = "SELECT * FROM tagwall ORDER BY id DESC";
$result = mysql_query($query, $connection) or die ("Couldn't complete query");
while($r = mysql_fetch_array($result)) {
$navn = $r["navn"];
$mail = $r["mail"];
$website = $r["website"];
$overskrift = $r["overskrift"];
$tekst = $r["tekst"];
$dato = $r["dato"];
$time = $r["time"];
$ip = $r["ip"];
$tekst = str_replace("
", "<img src='glad.gif'>", $tekst);
$tekst = str_replace("
", "<img src='bigsmile.gif'>", $tekst);
echo"<table border=\\"0\\" cellpadding=\\"3\\" cellspacing=\\"1\\" width=\\"350\\">";
echo "<tr>";
echo "<td colspan=\\"2\\" bgcolor=\\"#515151\\" background=\\"GFX/menu3.gif\\" height=\\"20\\" valign=\\"top\\"><h3>:: $overskrift :: - $time </td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor=\\"#909090\\" valign=\\"top\\"><h2>$tekst</td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor=\\"#515151\\" background=\\"GFX/menu3.gif\\" height=\\"20\\" valign=\\"top\\"><h2>Posted by: <a href=\\"mailto
mail\\">$navn</a> - <a href=\\"$website\\">$website</a> - $ip</td>";
echo "</tr>";
echo "</table>";
echo "<br>";
}
echo "</ol>";
mysql_close($connection);
?>
OG jeg har husket at connecte til mysql
...
en der kan se fejlen ?
.MortenJ