HTML beginner |
|
http://www.meta.../admin.php
Zoals jullie zien wordt er na het loginformpje een extra regel toegevoegd. Hoe kan ik dat wegdoen?
Het lukt mij niet.:s
Dit is de code:
<?php ob_start() ?>
<link href="test.css" rel="stylesheet" type="text/css">
<table width="900" border="5" align="center" cellpadding="2" cellspacing="0" bordercolor="#4B4B4B">
<tr>
<td><img src="images/nieuwsadmin.jpg" width="900" height="100"></td>
</tr>
<tr>
<td valign="middle">
<form action="" method="post" name="form1" class="text">
Login: <input name="login" type="text" class="textfield" id="login">
Paswoord: <input name="paswoord" type="password" class="textfield" id="paswoord">
<input name="Submit" type="submit" class="textfield" value="Submit">
</form>
</td>
</tr>
<tr>
<td>
<?
if($_COOKIE["login"] == "1") {
include ("addnews.php");
}else{
echo "U moet inloggen";
}
?>
</td>
</tr>
</table>
<?PHP
include_once("config_news.php");
if($_SERVER['REQUEST_METHOD'] == "POST")
{
$ilogin = $_POST['login'];
$ipaswoord = md5($_POST['paswoord']);
$res = mysql_query("SELECT * FROM gebruikers WHERE login='".$ilogin."'") or die(mysql_error());
if (mysql_num_rows ($res) != 0)
{
while ($assoc = mysql_fetch_assoc ($res))
{
if ($ipaswoord == $assoc['paswoord'])
{
setcookie(login, 1, $tijd_login);
header("Location: admin.php");
}
else
{
echo "<font=\"red\">Gegevens onjuist! Probeer opnieuw<font>";
}
}
}
}
?>
<link href="test.css" rel="stylesheet" type="text/css"> <table width="900" border="5" align="center" cellpadding="2" cellspacing="0" bordercolor="#4B4B4B"> <tr> <td><img src="images/nieuwsadmin.jpg" width="900" height="100"></td> </tr> <tr> <td valign="middle"> <form action="" method="post" name="form1" class="text"> Login: <input name="login" type="text" class="textfield" id="login"> Paswoord: <input name="paswoord" type="password" class="textfield" id="paswoord"> <input name="Submit" type="submit" class="textfield" value="Submit"> </form> </td> </tr> <tr> <td> <? if($_COOKIE["login"] == "1") { include ("addnews.php"); }else{ } ?> </td> </tr> </table> <?PHP include_once("config_news.php"); if($_SERVER['REQUEST_METHOD'] == "POST") { $ilogin = $_POST['login']; $ipaswoord = md5($_POST['paswoord']); { { if ($ipaswoord == $assoc['paswoord']) { header("Location: admin.php"); } else { echo "<font=\"red\">Gegevens onjuist! Probeer opnieuw<font>"; } } } } ?>
|