index.php:
<?php require_once('../INCs/config.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <meta name="Description" content="xxx" /> <meta name="Keywords" content="xxx" /> <meta name="Author" content="xxx" /> <title>xxx</title> <link rel="stylesheet" type="text/css" href="style/css.css" /> </head><body bgcolor="#a2a2a2"><br /><center> <div id="calosc"> <div id="gora"><div id="gorne">xxx</div> <div id="header"></div><div id="stats"></div></div> <div id="links"> xxx </div> <div id="top"> <div id="center"> <div id="screens"></div> <div id="newslogowanie"> <div id="logowanie"> <div style="align: justify; width: 250px; font-family: tahoma;"> <?php include('includes/logowanie.php'); ?></div> </div> <div id="news"><?php include('news.php'); ?> </div> </div> </div> <div id="footer"></div> </div></div><br /></center> </html>
logowanie.php:
<?php function ShowLogin($komunikat=""){ } ?> <?php if($_GET["wyloguj"]=="tak"){$_SESSION["zalogowany"]=0;echo "Zostales wylogowany z serwisu";} if($_SESSION["zalogowany"]!=1){ $query = mysql_query("select * from users where login = '".htmlspecialchars($_POST["login"])."' AND pass = '".htmlspecialchars($_POST["haslo"])."'", $connect); $_SESSION["zalogowany"]=1; $_SESSION["user_id"] = $_POST['login']; } } else ShowLogin(); }
oraz index1.php:
<?php if($_SESSION["zalogowany"] != 1){ exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <meta name="Description" content="xxx" /> <meta name="Keywords" content="xxx" /> <meta name="Author" content="xxx" /> <title>xxx</title> <link rel="stylesheet" type="text/css" href="style/css.css" /> </head><body bgcolor="#a2a2a2"><br /><center> <div id="calosc"> <div id="gora"><div id="gorne">xxx</div> <div id="header"></div><div id="stats"></div></div> <div id="links"> xxx </div> <div id="top"> <div id="center1"> <?php if($_SESSION["zalogowany"] == 1){ include('podstrony.php'); } ?> </div> <div id="footer"></div> </div></div><br /></center> </html>