Ok oto kody:
skrypt logowania:
CODE
<?php
$login_check = $_POST['login_check'];
$pass_check = $_POST['pass_check'];
$_SESSION['login']=$_POST['login_check'];
$_SESSION['password']=$_POST['pass_check'];
if (!file_exists("users/$login_check.dat")):
echo("Błędne dane");
elseif (file_exists("users/$login_check.dat")):
include("users/$login_check.dat");
if(($_SESSION['login'] == $login_check) && ($_SESSION['password'] == $pass_check)):
$_SESSION['rights'] = $rights;
print $_SESSION['rights'].'<br>';
echo ("witamy\n");
echo $_SESSION['login'];
echo("\nZalogowałeś się!!");
else:
echo("niepoprawny login lub/i haslo");
endif;
endif;
?>
A oto skrypt formularza który ma byc dostępny po zalogowaniu:
CODE
<?php session_start();
if(isset($_SESSION['rights']) && $_SESSION['rights']=='user')
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Formularz HTML-owy</title>
</head>
<body>
<form action="index.php?page=formularzPHP" method="post" enctype="multipart/form-data" name="formularzHTML-owy" class="style1" id="formularzPHP">
<table bgcolor="#999999" width="791" border="0" align="center" cellpadding="2" cellspacing="0" id="1">
<tr>
<td colspan="4"></td>
</tr>
<tr>
<td colspan="4"><div align="center">
<h2>Zamawianie łóżka </h2>
</div></td>
</tr>
<tr>
<td colspan="4"><hr size="2" color="#FFFFFF"/></td>
</tr>
<tr>
<td width="11%"><label>
<div align="left">Imie:</div>
</td>
<td width="40%" align="left"><input name="imie" type="text" size="35" />
</td>
...
a własciwie to chodzi mi o to aby w menu po lewo pokazał sie linik do formularza który wyświetli się po prawej stronie
A oto menu
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Menu</title>
<style type="text/css">
<!--
.style1 {font-size: 36}
-->
</style>
</head>
<body>
<p> </p>
<p> </p>
<p><span class="style1"><a href="index.php?page=witam">Witam na mojej stronie</a></span></p>
<p align="left" class="style1"><a href="index.php?page=strona1">Strona 1</p>
<!-- <p align="left" class="style1"><a href="index.php?page=strona2">Strona 2 </p> -->
<?
if(isset($_SESSION['rights']) && $_SESSION['rights']=='admin')
print '<p align="left" class="style1"><a href="index.php?page=strona2">Admin </p>';
if(isset($_SESSION['rights']) && $_SESSION['rights']=='user')
print '<p align="left" class="style1"><a href="index.php?page=formularz">Formularz </p>';
?>
<?php
header("Location:
http://stud.ics.p.lodz.pl/~avathav/pai/tmp/");?>
</body>
</html>
i co pomożecie ?
Z góry Dziękuję