Jump to content
php.lv forumi

autorizacija


edi

Recommended Posts

index.php

<?php
session_name (md5('SSS'));
session_start ();
$view	=	isset ( $_GET['view'] ) ? $_GET['view'] : NULL;
require_once('header.php');
require_once('functions.php');





switch ($view) {

  default:
     echo "hellow world :D";
   break;

 case pirmais:


 .....



   break;


 case lalala:



....



   break;





case login:

echo '<center><form action="" method="POST" name="login" >
	Login<br/><input type="text" class="inp" name="eml" size="23" value="" /><br />
	Password<br/><input type="password"  size="23" /><br />							
	<input id="" class="" type="submit" name="login" value="Ienākt"/>


</form></center>';


break;



}
require_once('footer.php');
?>

kā uztaisti tā, ja lietotājs nav ielogojies ar savu vai arī kādu cita loginu, tad vinam tiek atverta case "login";

+ lietotājs ievadot savus datus formā un nospiežot pogu tiek parmests uz default un sanem savu sessiju.

+ neautorizēts lietotājs nevarētu atvērt citas lapas neautorizējoties ..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...