Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by benanamen

  1. If you just leave a closing php tag hanging around of course it will break. Why would you remove proper code?
  2. What is the code from blog-approval.php? The tester is not displaying the error you posted. It is displaying a 1 as it should. If you echo'ed the line in your tester you would see a hash. Also, phpinfo() does not require echo.
  3. @gw1500se, there are numerous issues with the tutorial you linked to. It is a very bad example to learn from or use as a reference.
  4. BEWARE This user @haymanpl will threaten you with physical violence if he doesn't like your post. The exact response on the cross post that prompted this user was "Didnt you like the help you were getting on the other forum" (This one).
  5. You have a parenthesis floating outside of Php just above the closing body tag.
  6. It doesn't make sense to override a method with the same exact method. How about telling us what the real problem is you are trying to solve instead of asking about your attempted solution to solving it. How do you expect it to print anything when there is no code to output anything? No echo, no return, no nothing.
  7. It is called a Subquery. Now you know the proper term so you can look it up and learn about it.
  8. Assuming Sarcasm.... So are you saying you are OK with explicitly verifying 50% of a valid system login to an attacker? So instead of just saying "Username Invalid " you want to say "Congratulations, that exact username is in the database. Now you just need to guess the password that goes with it"?
  9. Just how many different errors do you expect? The registration (insert query) is either successful (true) or it fails (false). duplicate error = false other error = false no error = true You do not want to output system error messages to the user. In the case of a duplicate username, you do not want to specify that the username is already used. That would open you up to a User Enumeration Attack.
  10. Mysql is case insensitive by default. Doesnt matter how Fabian is cased.
  11. In addition to what @Barand said, your Method should return a Boolean. You have hard coded a redirect and have done nothing in case of failure which could be something other than a duplicate user. As is, if you want to redirect somewhere other than what you hard coded you have to edit the Class. Classes should be closed for modification. That is known as the "Open-closed Principle" and the the "O" in the SOLID Principal of Object-Oriented Programming. Do the redirect outside the class in the program flow. PSEUDO Code if ( $var->regUser($x,$y,$z) ) { // Success } OR $status = $var->regUser($x,$y,$z) ? 'Success' : 'Failed'; I would not put the password hashing in the method or class. Hashing a password is not really related to doing a DB insert query which when you get down to it, is really what you are doing. It would also mean you have to duplicate the hashing code such as the case of a password change. Pass the hashed password to the Class.
  12. What is the real problem you are trying to solve by doing this?
  13. Get rid of all the space in your method calls.
  14. Op, could you tell us why you want to do this?
  15. That error could not have happened from a windows update. Post the code.
  16. Instead of spinning your wheels trying to configure your own dev just do what I told you and you will be up and running in seconds
  17. The easiest way to get a correct LAMP stack working for older php is to run Laragon Portable with Php 5.4 https://laragon.org/
  18. Not sure what you are doing with this, but you can easily generate a CSPRNG (Cryptographically secure pseudorandom number generator) in Php7 with minimal code. <?php $bytes = random_bytes(5); var_dump(bin2hex($bytes));
  19. This reminds me of the Bike Shed Problem.
  20. It just doesn't matter. MariaDB is a drop-in replacement for MySQL. If you really want to head down this path you might as well throw in the "What about Percona?" which is another drop-in replacement fork of MySQL.
  21. I ran the code and it works. The only problem is you need to change the error variable like so: echo mysqli_error($con); Add this to the top of your page: mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); If your still having problems it is likely with the path to $con. You need to check that ABSPATH ."resources/ points to where con.php is.
  22. Seems to me that whatever your file setup is, $con is not accessible to the file you have the function in. And your still missing the $con parameter for the error call. To avoid a lengthy thread, PM your code files to me and I will review them.
  23. $con is outside the scope of your function. The function does not know it exists. You need to pass $con to the function. I would suggest learning about variable scope. I would also highly recommend you turn on error reporting.
  • 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.