Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


benanamen last won the day on September 8

benanamen had the most liked content!

Community Reputation

91 Excellent

About benanamen

  • Rank
    Master Coder

Contact Methods

  • Website URL
  • Yahoo

Profile Information

  • Gender
    Not Telling
  • Interests
    Email me at phpfreaks@galaxyinternet.us

Recent Profile Visitors

2,846 profile views
  1. benanamen

    DB query not working

    For starters you have several mismatched curly braces. If you used a proper IDE you would spot basic errors like this right away. I would also suggest you learn one of the standard code formatting styles and stick to it. You also have a substantial amount of duplicate code. DRY - Don't Repeat Yourself.
  2. benanamen

    help with sign up form error

    Stop what your doing! You are using obsolete code that has been removed from PHP. You need to use PDO. This tutorial will get you going. https://phpdelusions.net/pdo
  3. benanamen

    Check if username already exists

    Your your logic is incorrect. You do not check to see if the user already exists. You set a unique constraint on the username column and then attempt the insert capturing the duplicate error if any. Your method will create a race condition.
  4. benanamen

    help with writing a web crawler with LWP

    You do realize there are at least seventy thousand, two hundred other tutorials on how to write a web crawler in LWP right? This is also a Php forum. You might want to post to a PERL forum if the other seventy thousand, two hundred tutorials are not of any help.
  5. benanamen

    PHP sessions

    Sessions will work just fine but I would first suggest you rethink the multi page idea. What you want to do can be done in a single page and including the other pages when required. It would be much cleaner.
  6. benanamen

    Get Current Directory Errors ?

    I guess you also forgot you are supposed to check the REQUEST METHOD and not the name of a button.
  7. UIMan, I am seriously trying to have patience with you even after all these years, but c'mon man. Error message says it is expecting an integer. The error message is more than clear what is wrong, STRING GIVEN. Do you really not know how to create a variable with an integer as a value? Even a blind man can see the answer to this VERY simple first day in Php problem.
  8. benanamen

    Get Current Directory Errors ?

    UIman/phpsane, after over two years you should very well know that Php runs from the top down and that you need to check if there was a POST request before your processing code code runs. undefined index errors are first day in Php noob errors. After all this time you STILL cant grasp the most basic of basics. Truley unbelievable!
  9. benanamen

    PDO Update

    As far as picking a tutorial, it is one of the "better" ones, mainly because it uses PDO. Nevertheless, you still need to learn what the code is actually doing to know if there are any potential issues. The tutorial I linked to will give you a good understanding of using PDO. The rest will come with experience along with our feedback. I think it's safe to say we all prefer to help you with code YOU wrote instead of trying to debug some third party code copy/pasted from the Internet. Just keep at it. We were all beginners at one time. 😀
  10. benanamen

    PDO Update

    This Should be if ($_SERVER['REQUEST_METHOD'] == 'POST') Here is a tutorial to get you going. https://phpdelusions.net/pdo
  11. benanamen

    PDO Update

    There a few problems with that tutorial. The code (including your post) has been littered with try/catch blocks and exposing internal system errors to the user. PDO exceptions should be allowed to bubble up the stack. PHP handles it quite well. You can use set_exemption_handler if you want to do something custom. Outputting Internal system errors is only good for hackers. Also, the script depends on the name of a button to be submitted in order to work. That will completely fail in certain cases. You need to check the REQUEST METHOD. The code has also built in a race condition on the registration by checking if a username is available first. The insert should just be attempted and then capture the duplicate error if any. This is the one place where it would be OK to use a try/catch block. It also exposes specific username/email error messages that are a security risk. The script keeps running after redirects. There needs to be a die or exit right after the redirects. There are probably more issues as well. On the plus side, it uses PDO.
  12. Awwe c'mon, phpsane/forumcoder/uniqueideaman/uiman has only been at this for over two years. You cant expect him to know the basics yet.
  13. benanamen

    PHP Update Prepared Statement Script Help

    You are missing the closing bracket for the try and you are missing the catch. Looks like you are mixing up Mysqli and PDO. Perhaps you should study this PDO tutorial. https://phpdelusions.net/pdo
  14. benanamen

    PHP Update Script Help

    This is some very poorly written and dangerous code. You never ever put variables in a query. You are wide open to an SQL Injection Attack. PHP_SELF is also vulnerable to an attack. You need to use Prepared Statements and get rid of the action altogether for starters. And stop outputting internal system errors to the user.

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.