Здравейте.Пак правя тема ;д защото още едно нещо не ми е ясно и така...
как да направя следният код
Казаха ми да го направя с
Но нещо не стана
как да направя следният код
Казаха ми да го направя с
Код:
setcookie("TestCookie", $test);
setcookie("TestCookie", $test, time()+3600); /* expire in 1 hour */
Ето кода на login.phpWarning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\opit\header.php:13) in D:\xampp\htdocs\opit\login.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\opit\header.php:13) in D:\xampp\htdocs\opit\login.php on line 6
Код:
<?php
@session_start();
include('connect2.php');
include('header.php');
setcookie("TestCookie", $test);
setcookie("TestCookie", $test, time()+3600); /* expire in 1 hour */
?>
<body>
<div style="background-color: #2c2c2c; width: 900px; height: 20px; padding-top: 3px;margin-top: 3px;"><b class="hui">News: Пробен сайт by: Zloto</b></div>
<div class="menu1"><b class="hui">Меню</b>
<div style="background-color: #2c2c2c; width: 190px; height: 200px; float: left; margin-top:3px;">
<div class="arrowlistmenu">
<ul style="list-style: none; padding-top: 10px; float: left;">
<li><a class="hui23" href="#"/>Начало</a></li>
<li><a class="hui23" href="#"/>Сървъри</a></li>
<li><a class="hui23" href="#"/>Топ15</a></li>
<li><a class="hui23" href="#"/>За нас</a></li>
<li><a class="hui23" href="#"/>Банлист</a></li>
<li><a class="hui23" href="#"/>Връзка с екипа</a></li>
<li><a class="hui23" href="#"/>Потребители</a></li>
</ul>
</div>
</div></div>
<div class="menu2"><b class="hui">Новини</b>
<div style="background-color: #2c2c2c; width: 500px; height: 200px; float: left; margin-top:3px;">
<?php include('NEWS.php');?>
</div></div>
<div class="menu3"><b class="hui">Меню</b>
<div style="background-color: #2c2c2c; width: 190px; height: 100%; float: left; margin-top:3px;"><br/>
<?php
$lgsl_zone_number = 1;
$output = "";
require "lgsl/lgsl_files/lgsl_zone.php";
echo $output;
?>
</div></div>
<div class="menu1"><b class="hui">Потребителска Форма</b>
<div style="background-color: #2c2c2c;background-repeat: no-repeat; width: 190px; height: 200px; float: left; margin-top:3px;"><br/>
<?php
if(isset($_POST['login'])){
//Данни от формуляра
$username = $_POST['username'];
$password = $_POST['password'];
//Защита срещу html тагове..
$username = htmlspecialchars($username);
$username = addslashes($username);
//Променливите за проверка на юзърнейм-а и паролата
$query = "SELECT * FROM register WHERE username = '$username'";
$result = MYSQL_QUERY($query) or die(mysql_error());
$number = MYSQL_NUMROWS($result);
$i = 0;
WHILE ($i < $number){
$pass = mysql_result($result,$i,"password");
$user = mysql_result($result,$i,"username");
$id = mysql_result($result,$i,"id");
$email = mysql_result($result,$i,"email");
$i++ ;
}
if ($number=='0')
{
echo "<p><b class='hui'>Няма такъв потребител</b></p>";
}
else
{
if ($password==$pass)
{
$_SESSION['username']=$user;
$_SESSION['id']=$id;
$_SESSION['email']=$email;
echo "<p><b class='hui'>Здравей ";
echo "$username</b></p>";
}
else
{
echo "<p><b class='hui'>Грешна парола. Опитайте отново</b></p>";
}
}
MYSQL_CLOSE();
}
?>
</div>
</div>
<div class="menu2"><b class="hui">Новини</b>
<div style="background-color: #2c2c2c; width: 500px; height: 200px; float: left; margin-top:3px;">
<?php include('NEWS.php');?>
</div></div>
<div class="menu1"><b class="hui">Меню</b>
<div style="background-color: #2c2c2c;background-repeat: no-repeat; width: 190px; height: 200px; float: left; margin-top:3px;"><br/>
<div style="background-image:url(images/hahaha.jpg); width: 150px; height:150px; border: 1px solid black;"></div>
</div>
</div>
</div>
</div>
<b class="hui">Design by:Zloto™ Code by: Zloto™ - 2008-2010</b>