Henaro Posted December 8, 2007 Share Posted December 8, 2007 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 Quote Link to comment Share on other sites More sharing options...
jacksonmj Posted December 8, 2007 Share Posted December 8, 2007 Try changing if (substr(md5($key)), 0, 16)==substr($_SESSION['a_stuff'], 0, 16)){ to if (substr(md5($key), 0, 16)==substr($_SESSION['a_stuff'], 0, 16)){ Quote Link to comment Share on other sites More sharing options...
Henaro Posted December 8, 2007 Author Share Posted December 8, 2007 Ah thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.