Wtf, I say... wtf?

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
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Wtf, I say... wtf?

Post by Jim »

Code: Select all

function Secure()
	{	
		global $conf;
		
		$u_cookie = $_COOKIE['".$conf['cookie_pre']."user']; // Line 12
		$p_cookie = $_COOKIE['".$conf['cookie_pre']."pass'];
	
		// Check for necessary cookies
		if ($u_cookie && $p_cookie)
		{
			session_start();
			// We'll do three checks -
			// 1. Check the name/pass against the database
			// 2. Check the user's IP against the last IP logged in the same session
			// 3. Check and log the user's administrative level
			
			$check_name = mysql_query("select id from ".$conf['table_pre']."users where username = '{$_COOKIE['panel_user']}' and password = '{$_COOKIE['panel_pass']}'");
			$num = mysql_num_rows($check_name);
				if ($num != '1') { $this->login(); }
				
			$check_ip = mysql_query("select id from ".$conf['table_pre']."users where username = '{$_COOKIE['panel_user']}' and sess_id = '{$_SESSION['sess_id']}'");
			if (!$check_ip) { echo mysql_error(); }
			$num = mysql_num_rows($check_ip);
				if ($num != '1') { $this->login(); }
				
			$check_level = mysql_query("select level from ".$conf['table_pre']."users where username = '{'panel_user']}' and password = '{$_COOKIE['panel_pass']}'");		
				$info = mysql_fetch_row($check_level);
				
							
		
		}
Parse error: parse error, expecting `']'' in /home/ogresnet/public_html/admin/classes/secure.php on line 12


*stumped*
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Code: Select all

$u_cookie = $_COOKIE[$conf['cookie_pre'].'user']; // Line 12
      $p_cookie = $_COOKIE[$conf['cookie_pre'].'pass'];
?
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Post by Jim »

Yup - that did it. I'm not sure why that didn't work the first time I tried it. Thanks dude.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

i think it was cos of the "A".....see, you dont have "A" in your name, but JAM does :lol:
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

And his is in all caps.......so he's a level higher ;)

-Nay
Post Reply