Tjah.. Min tagwall indeholder efterhånden mange fejl..
Nogen som kan "rense", fixe/lave den?
<?
session_start();
if($_SESSION["tagwall"] != 1) {
include("config.php");
$ip = $_SERVER[REMOTE_ADDR];
$farve = "#000000";
$tekst = $_SESSION["brugernavn"] . " er netop logget på!";
$navn = "Information";
$dato = date('d/m/Y H:i:s');
mysql_query("INSERT INTO tagwall (navn, dato, tekst, farve, ip) VALUES ('$navn', '$dato', '$tekst', '$farve', '$ip')");
$_SESSION["tagwall"] = 1;
}
if (session_is_registered("brugernavn") AND ("kodeord")) {
include "config.php";
$hent = mysql_query("SELECT * FROM community WHERE brugernavn = '$_SESSION[brugernavn]'") or die(mysql_error());
$vis = mysql_fetch_array($hent);
?>
<?
if($_POST[action] == "skriv") {
if($_POST[tekst] == "") {
print "Du har ikke skrevet en besked..";
}else{
include "config.php";
$navn = $_SESSION[brugernavn];
$farve = $_POST[farve];
$tekst = htmlspecialchars($_POST[tekst]);
$dato = date('d/m/Y H:i:s');
$ip = $_SERVER[REMOTE_ADDR];
mysql_query("INSERT INTO tagwall (navn, dato, tekst, farve, ip) VALUES ('$navn', '$dato', '$tekst', '$farve', '$ip')");
}
}
?>
<html>
<head>
<meta name="Generator" content="Stone's WebWriter 4">
<link rel="stylesheet" HREF="style.css" type="text/css">
</head>
<form action="index.php" method="post">
<input type="submit" value="Vælg side">
<select name="show" size="1">
<?
include("config.php");
$sql = "SELECT id FROM tagwall";
$query = mysql_query($sql);
$num = mysql_num_rows($query);
$average = $num/10;
$pages = ceil($average);
$page_number = 0;
while ($page_number < $pages)
{
$test = $pages-1;
$page_number++;
$show_number = $page_number*10-10;
echo("<option value=\\"".$show_number."\\">".$page_number."</option>");
}
?>
</select>
</form>
<form action="index.php" method="post">
<input type="hidden" name="action" value="skriv">
<?
include "config.php";
$admin = mysql_query("SELECT * FROM community WHERE brugernavn = '$_SESSION[brugernavn]'") or die(mysql_error());
$vis_admin = mysql_fetch_array($admin);
if($vis_admin[status] == "Ejer") {
print "<font color='orange'>";
}
if($vis[status] == "Redaktør") {
print "<font color='white'>";
}
if($vis[status] == "Reporter") {
print "<font color='red'>";
}
if($vis[status] == "På prøve") {
print "<font color='green'>";
}
if($vis[status] == "Normal") {
print "<font color='black'>";
}
if($vis[status] == "VIP") {
print "<font color='yellow'>";
}
if($vis[status] == "Alt muligt mand") {
print "<font color='green'>";
}
if($vis_admin[status] == "Grafiker") {
print "<font color='blue'>";
}
if($vis_admin[status] == "Supporter") {
print "<font color='pink'>";
}
?>
<input type="text" name="tekst" size="20" value="besked her" onFocus="if(this.value=='besked her'){this.value=''}" onBlur="if(this.value==''){this.value='besked her'}"><br>
<input type="submit" name="submit" value="Tag">
<input type="button" onclick="window.location='index.php'" value="Opdater">
</input>
<hr size="1">
</form>
<font color="#8C8C8C">
<table width="450" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #808080;">
<tr valign="top">
<td background="../../images/kombar.jpg" width="450" height="15" valign="middle">
<a href="../community/profil.php?brugernavn=<? echo $vis_beskeder[navn]; ?>"><b><font color="<? echo $vis_beskeder[farve]; ?>"><? echo $vis_beskeder[navn]; ?></b></a></font> <font face="tahoma" size="1">(<? echo $visk[status]; ?>)</font>
</td>
<td align="right" valign="middle" background="../../images/kombar.jpg" width="340" height="15">
</td>
</tr>
<tr valign="top">
<td>
<? echo $vis_beskeder[tekst]; ?>
</td>
<td valign="center" align="center">
<? echo $visk[ikon]; ?>
</td>
</tr>
<tr valign="top">
<td align="right" background="../../images/kombar.jpg" width="450" height="15" valign="bottom">
</td>
<td align="right" background="../../images/kombar.jpg" width="450" height="15" valign="bottom">
<font face="tahoma" size="1">den <? echo $vis_beskeder[dato]; ?></font>
</td>
</tr>
</table>
<?
}
?>
Indlæg senest redigeret d. 19.06.2006 17:06 af Bruger #10083