Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Development
Flashback PHP - A Habbo CMS written in vanilla PHP
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Markshall" data-source="post: 465277" data-attributes="member: 1872"><p>Good luck with this.</p><p>Is this more of an learning-curve project to build experience in PHP as you go along? If so, since you’re asking for tips, here’s a quick one for you:</p><p></p><p>[ICODE]password_verify[/ICODE] returns a Boolean value, and so does the method you’ve posted. So instead of doing this:</p><p></p><p>[CODE=php]if($stmt->rowCount() > 0) {</p><p> if(password_verify($this->password, $this->result['password'])) {</p><p> return true;</p><p> } else {</p><p> return false;</p><p> }</p><p>}[/CODE]</p><p></p><p>You can just do this:</p><p>[code=php]if ($stmt->rowCount() > 0) {</p><p> return password_verify($this->password, $this->result['password']);</p><p>}[/code]</p><p></p><p>Or even simpler:</p><p>[code=php]return $stmt->rowCount() && password_verify($this->password, $this->result['password']);[/code]</p></blockquote><p></p>
[QUOTE="Markshall, post: 465277, member: 1872"] Good luck with this. Is this more of an learning-curve project to build experience in PHP as you go along? If so, since you’re asking for tips, here’s a quick one for you: [ICODE]password_verify[/ICODE] returns a Boolean value, and so does the method you’ve posted. So instead of doing this: [CODE=php]if($stmt->rowCount() > 0) { if(password_verify($this->password, $this->result['password'])) { return true; } else { return false; } }[/CODE] You can just do this: [code=php]if ($stmt->rowCount() > 0) { return password_verify($this->password, $this->result['password']); }[/code] Or even simpler: [code=php]return $stmt->rowCount() && password_verify($this->password, $this->result['password']);[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Development
Flashback PHP - A Habbo CMS written in vanilla PHP
Top