Rigodon Posted August 10, 2015 Share Posted August 10, 2015 Hello,I'm starting with object-oriented programming and I have the problem that I do not know how to efficiently manage captured with methods.For example: class logowanie { public function valid_login_name() { $username = $_GET['username']; $login_name = 'd56b6asdsada53855679cb1d252da'; if(md5($username) === $login_name ){ echo "extra"; } elseif(md5($username) !== $login_name && !empty($username) ){ echo "błedny login"; } elseif(md5($username) == null) { echo "nie podales loginu"; } I Checks if the given login is the same as that stored in the variable.I know that I can refer to it by, for example: $login= new logowanie(); $login->valid_login_name(); I have also: class pozalogowaniu { public function afterloggin(){ header("Location: http://www.example.com/"); } } And now my question in the style of dump question. How to do it when I want to show the method "afterloggin" only if the method valid_login_name () returns the result from the first condition? 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.