So this is a normal HTML login (the file is called admin.php):
Code: Select all
<table border=1 align=middle>
<form method="post" action="news.php"><td>Password:</td><td><input type="password" name="password"><input type="submit" value="Enter"></td></form></table>
Code: Select all
<?
session_start();
if($_POST['password'] == 'pass'){
$_SESSION['loged_in'] = true;
}
else{
include("admin.php");
exit;
}
?>
<form method="post" action="news.php">
<table>
<tr>
<td>
<select name="number">
<option value ="1">1</option>
<option value ="2">2</option>
<option value ="3">3</option>
<option value ="4">4</option>
</select>
<textarea name="news" wrap="virtual" rows="10" cols="40" style="color: #800000">New message</textarea></td></tr><tr><td>
<a href="admin.php?logout=1">Iziet</a>
<? if(isset($_REQUEST['logout'])) session_destroy();?>
</td></tr><tr align="right"><td>
<input type="submit" name="submit" value="Add">
</form>
</td>
</tr></table>
<?
@$news=$_POST['news'];
@$number=$_POST['number'];
$connection=mysql_connect('127.0.0.1','*','*') or die ("Unable to connect...");
mysql_select_db('*',$connection);
if(strlen($news)>0){
$query=mysql_query("INSERT INTO `info`(`message`, `number`) VALUES ('$news', '$number')",$connection);
}
mysql_close($connection);
?>
else{
include("admin.php");
exit;
Does anyone know what the problem is?