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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.