Advertisement

05.16.2008 at 05:06PM PDT, ID: 23410036
[x]
Attachment Details

PHP help - I get a blank page

Asked by TheInnovator in PHP Scripting Language

Tags: PHP

I am trying to create a login page but once I login, it goes through but I get a blank page.
code attachedStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
//-----editpage.php---------	
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On');
ini_set('display_startup_errors', 'On');
 
	$database = "serve_forms";
	mysql_connect("localhost", "test", "test") or die(mysql_error());
	@mysql_select_db($database) or die( "Unable to select database");
	
	include("functions.php");
	checkLogin(1 2 3);
	
	//1=> SYS ADMIN(everything plus DELETE), 2=>ADMIN(edit,view,update) 3=>ANALYST(view only)
	echo("hello");
 
?>
 
 
 
//-----functions.php-----------
<?php
	#require_once('db.php');
	
	//LEVEL ACCESS
	//1=> SYS ADMIN(everything plus DELETE), 2=>ADMIN(edit,view,update) 3=>ANALYST(view only)
	function checkLogin($role)
	{
		if(!$_SESSION['logged_in'])
		{
			$access = FALSE;
		}
		else {
			$kt = split(' ', $role);
			
			$query = mysql_query('SELECT level_access FROM tblUsers WHERE ID = "'.mysql_real_escape_string($_SESSION['user_id']).'"');
			$row = mysql_fetch_assoc($query);
			
			$access = FALSE;
					
			while(list($key,$val)=each($kt))
			{
				if($val==$row['LEVEL_access'])
				{//if the user level matches one of the allowed levels
					$access = TRUE;
				}
			}
		}
		if($access==FALSE)
		{
			header("Location: login.php");
		}
				
	}
?>
[+][-]05.16.2008 at 11:26PM PDT, ID: 21588169

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: PHP
Sign Up Now!
Solution Provided By: bansidhar
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.16.2008 at 11:29PM PDT, ID: 21588177

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628