session query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
devilgrendall
Forum Newbie
Posts: 17
Joined: Fri Sep 10, 2004 10:29 am
Location: Warwickshire
Contact:

session query

Post by devilgrendall »

hi, i need some help with a session problem, ive set up a session to identify peoples passwords+username and will only pull out the editors entries into the database. Question is how do i pull all the editors entries under an administrantion login???? the code below is what im using to identify the user.

Any help or hints much appreciated.
Thanks

Jay

Code: Select all

<?php

	$status = authenticate($f_user,$f_pass);
	
	if ($status == 1)
	{
		
		session_start();
	
		session_register("SESSION");
	
		session_register("SESSION_UNAME");
		$SESSION_UNAME = $f_user;
			
		header("Location: admin.php");
		exit();		
		}
		else
		{
		
		header("Location: error.php?e=$status");
		exit();				
		}

		function authenticate($fuser,$fpass)
		{

		include ("secure/valdata.dac");
		If (mysql_num_rows($result) == 1)
		{
			if (strcmp(mysql_result($result,0,pass),$fpass) == 0 )
			{	
				return 1;
			}
			else
			{
				return 0;
			}
			}
			else
			{
			return 0;
			}
			}

?>
:lol: :lol: :lol:
?>
Post Reply