Jump to content

function access


jimfog
 Share

Recommended Posts

I have a created a class where in it you will find password hashing/checking functions...for example:

public static function hash($password) {	  return crypt($password,self::$algo.self::$cost .'$'.self::unique_salt());}

And this is the code where you apply the function to a password submitted by the user with a form:

  $pass_hashed = PassHash::hash($_POST['password']);

My question is why the code below is wrong-according to Netbeans IDE?

  $pass_hashed = PassHash->hash($_POST['password']); 

Since I am accessing the has function OUTSIDE the class why it is wrong. PassHash is the name of the class.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...