Wyedytowalem tak jak mi sie wydawało ze bedzie dobrze
func.php
<?php
// Tworzenie linkow dla zalogowanego usera
function menu_user() {
if (isset($HTTP_SESSION_VARS['zarej_user'])) {
<td colspan="3" align="center" height="32">
Zalogowany jako: <b>'.$user.'</b>.
</td>
</tr>
</table>';
} else {
echo'<table><tr><td colspan="3" align="center" height="32"> <form action="index.html" method="post">
<input type="text" name="login_log" size="10" class="t1">
<input type="password" name="pass_log" size="10" class="t1"></td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="image" src="images/zaloguj.gif"></form> <a href="rejestracja.html"><img src="images/zarejestruj.gif" alt="" width="67" height="16" border="0"></a></td>
</tr>
</table>';
}
}
?>
logowanie.php
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="4%" class="title">
</td>
<td class="title">
<u><b>LOGOWANIE</b></u> // panel logowania
</td>
</tr>
<tr>
<td width="100%" colspan="2" align="center">
<img border="0" src="images/hr.gif" width="337" height="1" alt="" /></td>
</tr>
</table>
<table border=0 cellpadding=3 cellspacing=0 width="100%">
<tr>
<td width="100%" align="center" class="tsc_m">
<?
if(isset($HTTP_POST_VARS['login_log']) && isset($HTTP_POST_VARS['pass_log'])) {
// Skrypt sprawdzajacy prawdziwosc danych podczas logowania
$user = $HTTP_POST_VARS['login_log'];
$pass = $HTTP_POST_VARS['pass_log'];
$zapytanie = 'select * from users '
."where name='$user' "
." and pass='$pass'";
{
// Jezeli dane sa prawdziwe nastepuje zarejestrowanie identyfikatora usera
$HTTP_SESSION_VARS['zarej_user'] = $user;
echo 'Zalogowany jako '.$user.''; } else {
echo 'Nieprawidłowe dane!'; }
} else {
menu_user();
}
?>
</td>
</tr>
</table>
index.php
<?
ob_start();//Tworzenie sesji i sprawdzanie czy user zalogowal sie
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<? require('inc/func.php'); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="pl">
<title>Smieszne linki</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" topmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="760">
<tr>
<td width="100%" align="center">
</td>
</tr>
<tr>
<td width="100%" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="719">
<tr>
<td width="350">
<table border="0" cellpadding="0" cellspacing="0" width="350">
<tr>
<td colspan="7" width="350">
<a href="index.html">
<img id="img_03" src="images/img_03.gif" width="104" height="46" alt="" border="0" /><img id="img_04" src="images/img_04.gif" width="101" height="46" alt="" border="0" /></a></td>
</tr>
<tr>
<td width="350" colspan="7"> </td>
</tr>
<tr>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="wyslij_link.html"><img border="0" src="images/img_08.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="top50.html"><img border="0" src="images/img_10.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="statystyki.html"><img border="0" src="images/img_12.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="kontakt.html">
<img id="img_14" src="images/img_14.gif" width="77" height="20" border="0" /></a></td>
</tr> </tr>
</table>
</td>
<td valign="top" width="369">
<? include "inc/login_form.php" ?>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="390">
<tr>
<td width="394" height="390" valign="top" align="left">
<?
if($co=="reklama") { include "inc/reklama.php"; }
elseif($co=="kontakt") { include "inc/kontakt.php"; }
elseif($co=="statystyki") { include "inc/statystyki.php"; }
elseif($co=="top") { include "inc/top.php"; }
elseif($co=="wyslij") { include "inc/wyslij.php"; }
elseif($co=="wspolpraca") { include "inc/wspolpraca.php"; }
elseif($co=="linki_kat") { include "inc/linki_kat.php"; }
elseif($co=="rejestracja") { include "inc/rejestracja.php"; }
elseif($co=="logowanie") { include "inc/logowanie.php"; }
else { include "inc/linki.php"; }
?>
</td>
<td width="353" height="390" valign="top" align="center">
<? include('inc/news.php'); ?>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="wspolpraca.html">
<img border="0" src="images/wspolpraca.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="reklama.html">
<img border="0" src="images/reklama.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="redakcja.html">
<img border="0" src="images/redakcja.gif" width="77" height="20" alt="" /></a></td>
<td>
</td>
<td>
<a href="kontakt.html">
<img src="images/kontakt_2.gif" width="77" height="20" border="0" /></a></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="640" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="640" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/stopka_01.gif" width="6" height="30" alt=""></td>
<td width="628" background="images/stopka_tlo.gif" align="center">
<font face="Tahoma" size="1"><font color="#D5F0FB">Copyright 2003-2005 <b>śmieszne linki</b>. All rights reserved.
Project: </font> <a href="http://www.scx.pl"><font color="#D5F0FB">Scx.pl</font></a></font></td>
<td>
<img src="images/stopka_03.gif" width="6" height="30" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Zrobilem to tak jak mowiles ale nic to nie daje ;( Czy moglbys mi pokazac jak to zrobic bo ja juz sie kompletnie pogubilem....
P.S. Wiem ze juz ostro zawracam Wam głowe, ale sam sobie nie poradze z tym.