hej kan ikke finde ud af hvad fejlen er..
her er koden:
<?php session_start(); ?>
<html>
<head>
<LINK rel="stylesheet" href="../style.css" type="text/css">
</head>
<body align="center">
<p>
<?php
if (empty($_SESSION["LoggetInd"]))
{
?>
<form action= "<?php echo $_SERVER["PHP_SELF"]; ?>"
method="post">
<input type="password" name="Kode" size="24" border="0">
<input type="submit" name="LoggetInd" value="Log Ind" border="0">
</form>
<?php
if ($_POST["Kode"] == "assword")
{
$_SESSION["LoggetInd"] = "Jepsen";
include("config.php");
}
else
{
?>
<a href="tagwall.php?amp;more=1">Se flere tags</a> | <a
href="tagwall.php?action=write">Skriv</a><br>
<?php
$action = $_GET["action"];
if ($action == "write")
{
echo '
<form method="post" action="tagwall.php" align="center">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td width="226">Dit navn:</td>
<td><input id="name" class="text" size="30" name="navn"></td>
</tr>
<tr>
<td><p>Din e-mail</p></td>
<td><input name="email" class="text" type="text" id="email"
size="30"></td>
</tr>
<tr>
<td><p>Din hjemmeside</p></td>
<td><input name="url" class="text" type="text" id="url"
size="30"></td>
</tr>
<tr>
<td valign="top" height="132">Din besked:</td>
<td height="132"><textarea id="text" class="textarea" name="text"
rows="8" cols="35"></textarea></td>
</tr>
<tr>
<td height="40"> </td>
<td vAlign="bottom" height="40">
<input type="submit" class="submit" value="Tilføj Besked!"
name="Submit"><br>
<input type="reset" class="submit" value="Slet alt!"
name="Reset"></td>
</tr>
<tr>
<td height="22"> </td>
<td vAlign="bottom" height="22">Alle felter skal udfyldes!!</td>
</tr>
</table>
</form>';
}
else
{
$navn = $_POST["navn"];
if ($_POST["navn"] == "Navn") $navn = "Anonym";
$email = $_POST["email"];
if ($_POST["email"] == "E-mail") $email =
"null@null";
$url = $_POST["url"];
if ($_POST["url"] == "url") $url = "Anonym";
$text = $_POST["text"];
$time = date("Y-m/d H:i:s");
mysql_connect($host, $user, $password) or
die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$ip = $_SERVER["REMOTE_ADDR"];
if (!empty($_POST["text"]))
{
$insertSQL = "INSERT INTO tagwall (navn, email,
url, time, ip, text) VALUES ('" .
addslashes($navn) . "', '" . addslashes($email) . "', '" .
addslashes($url) . "', '$time', '$ip', '" .
addslashes($text) . "')";
mysql_query($insertSQL) or die(mysql_error());
}
$limit = ($_GET["more"]) ? 1000 : 10;
$result = mysql_query("SELECT * FROM tagwall ORDER BY
id DESC LIMIT $limit") or
die(mysql_error());
while ($row = mysql_fetch_array($result))
{
echo "
<br><a href='mailto:" .
htmlspecialchars(urlencode($row['email'])) . "'>" .
htmlspecialchars($row['navn']) .
"</a> [<a href=\"Slet.php?id=" . $row[id] . "\">Slet</a>]<br>" .
$row['url'] . "<br>" . $row['time'] . "<br>" .
nl2br(htmlspecialchars($row['text'])) . "<br>";
}
mysql_close() or die(mysql_error());
}
}
?>
<a href="tagwall.php?amp;more=1">Se flere tags</a> | <a
href="tagwall.php?action=write">Skriv</a>
</p>
<?php
}
?>
</body>
</html>
du får den fejl
Warning: mysql_connect() [function.mysql-connect]: Can't connect
to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2) in
/var/www/hotserv.dk/users/musiklir/tagwall/tagwall1.php on line
25
Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
men du kan selv se det på
http://www.musiklir.hotserv.dk/tagwall/tagwall1.php
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials