Jump to content

[SOLVED] Some questions and some difficulty on encrypting sessions


Henaro

Recommended Posts

Hello everyone~

 

I've been having trouble with this function for a bit:

 

function get_ses($pass, $key) {
//Take the first 16 chars of session md5 and validate
if (substr(md5($key)), 0, 16)==substr($_SESSION['a_stuff'], 0, 16)){	
	//Go 16 characters into the session, and take 16 characters out
	if (substr(md5($pass))==substr($_SESSION['a_stuff'], 16, 16)){
		$ses_vald = "true";
	}else{
		$ses_vald = "false";
	}
}else{
	//If key isn't valid return false
	$ses_valid = "false";
}
return $ses_vald;
}

 

I get an error that says:

Parse error: syntax error, unexpected ',' in /home/x/x/x/x/x/x/stuff/funs/get_ses.php on line 4

The problem is, is that I'm unable to locate that unexpected ,. 

 

Also, is this a good way to encrypt a login?  Like if someone logs in and their pass is encrypted plus a set key on the config file? 

 

I'd like some criticism on it...

 

Thanks,

Hen

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.