Kod: Zaznacz cały
<?php
error_reporting(E_ALL); // poziom raportowania, http://pl.php.net/manual/pl/function.error-reporting.php
ini_set('display_errors', 1);
?>
<?
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title>Shoutbox</title>
<style type="text/css">/*<![CDATA[ */
.cbalink {
display:none;
}
/*]]>*/</style>
</head>
<body>
<?
if(isset($_POST['pass']))
{
if($_POST['pass']=='tajnehaslo')
{
$_SESSION['admin']='ok';
}
}
if(isset($_GET['admin']) && $_GET['admin']=='wyloguj')
{
$_SESSION['admin']='';
}
?>
<table border="1" width="150">
<tr>
<td><a href="index.php?admin=ok">SHOUTBOX</a>
</td>
</tr>
<tr>
<td>
<iframe width="100%" height="300" border="0" frameborder="0" src="shoutbox.php" name="box">
Twoja przeglądarka nie obsługuje ramek wbudowanych lub jest obecnie skonfigurowana tak, aby nie wyświetlać ramek wbudowanych.
</iframe></td>
</tr>
<tr>
<td>
<form method="POST" action="shoutbox.php" target="box">
Nick: <input type="nick" name="nick" size="20">
</td>
</tr>
<tr>
<td>
Treść:<br><textarea rows="4" name="tresc" cols="20"></textarea>
</td>
</tr>
<tr>
<td align="center">
<input type="submit" value="OK"> <input type="reset" value="Reset"></form>
</td>
</tr>
<?
if(isset($_GET['admin']) && $_GET['admin']=='ok')
{
echo '<tr><td><form method="POST" action="index.php">
<p align="center">
<b>ADMIN</b><br>Proszę podać hasło:<br>
<input type="password" name="pass" size="20"><br>
<input type="submit" value="OK"></p>
</form></td></tr>';
}
if($_SESSION['admin']=='ok')
{
echo '<tr><td align="center">Admin: <a href="index.php?admin=wyloguj">WYLOGUJ</a></td></tr>';
}
?>
</table>
</body>
</html>
2. W okienku shoutboxa jest cały czas "Darmowy Hosting CBA.PL"Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/virtual/schoolhack.cba.pl/shout/index.php:6) in /var/www/virtual/schoolhack.cba.pl/shout/index.php on line 7
Za pomoc z góry dziękuję