Fejlmeddelse (T_VARIABLE)
Hej drenge!Er der ikke en der kan se på nedenstående kode?
Jeg får en T_VARIABLE fejl et eller andet sted (linje 111), men nu har jeg stirret mig blind på den og kan ikke se nogle tegnsætnings-fejl. Måske et par friske øjne kan hjælpe?
<?php
ob_start();
session_start();
if (!isset( $_SESSION['adgang'])) {
header("location:index.php");
exit();
} else {
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">
<meta name="robots" content="nocache" />
<title>Lager & Service Klubben</title>
<link rel="stylesheet" href="css/style.css" />
<!--[if IE]> <style type="text/css">@import "css/IE-override.css";</style>
<![endif]-->
</head>
<body>
<div id="wrapper">
<div id="container">
<img src="images/toplogo.jpg" alt="" />
<div id="menu_layer">
<ul>
<li><a href="">Nyheder</li>
<li><a href="">Skemaer</a></li>
<li><a href="">Links</a></li>
<li><a href="">Opret Administrator</a></li>
<li><a href="logout.php">Log Ud</a></li>
</ul>
</div>
<div id="input_layer">
<form name="opret" method="POST">
<p class="input_brugernavn">Brugernavn:</p>
<input type="text" name="username" maxlength="18" class="bruger_inputbox" />
<p class="input_password">Password:</p>
<input type="password" name="password" maxlength="18" class="password_inputbox" />
<p class="input_repeatpassword">Gentag Password:</p>
<input type="password" name="repeat_password" maxlength="18" class="repeatpassword_inputbox" />
<input type="submit" value="Opret" name="mysubmit" class="opret_button" />
<input type="hidden" name="submitted" value="TRUE" />
</form>';
if (isset($_POST['submitted'])) {
require_once ('mysql_connect.php');
if (!empty($_POST['username'])) {
$u = mysql_real_escape_string($_POST['username']);
} else {
echo '<p class="error_username">Indtast Brugernavn!</p>';
$u = FALSE;
}
if (!empty($_POST['password'])) {
$p = $_POST['password'];
} else {
echo '<p class="error_password">Indtast Password!</p>';
$p = FALSE;
}
if (!empty($_POST['repeat_password'])) {
$repeat_p = $_POST['repeat_password'];
}
if (!empty($_POST['password']) && empty($_POST['repeat_password'])) {
echo '<p class="error_password">Indtast Password!</p>';
}
if (empty($_POST['password']) && !empty($_POST['repeat_password'])) {
echo '<p class="error_password">Indtast Password!</p>';
}
if ($_POST['password'] !== $_POST['repeat_password'] && !empty($_POST['password']) && !empty($_POST['repeat_password'])) {
echo '<p class="error_password">Password matcher ikke!</p>';
} else {
$valid_password = md5('password');
}
if ($u && $valid_password {
$usertable="users"
$query = "SELECT * FROM $usertable WHERE username='$u' AND password='$valid_password'";
$result = mysql_query($query);
if (@mysql_num_rows($result) == 1) {
echo '<p class="error_entry">Bruger eksisterer allerede!</p>';
} else {
mysql_query(INSERT INTO $usertable (username, password) VALUES ('$u', '$valid_password');
echo '<p class="error_entry">Bruger oprettet!</p>';
}
echo '
</div>
</div>
</div> <!-- End of Wrapper !-->
<div id="shadow_bottom"></div>
</body>
</html>';
}
?>