Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code don't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here here and here here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP codedon't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code, store it in an external configuration file.
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.
Security
This code is not secure.
SQL Injection
You are trusting the user input completely (except in the login
function where you do use mysqli_real_escape_string
, which is not secure enough). Use prepared statements instead. You should also read up on SQL injections in general.
Other
This is all minor in comparison to the SQL injection.
- don't hardcode your password in the PHP code, store it in an external configuration file (outside the web root as otherwise your passwords will be exposed).
- don't echo complete errors to the user. Use a custom error string instead.
md5
is not a good enough hashing function, use something likebcrypt
instead. (see for example here and here)
Code
query
function
The query
function just renames the execute
function, and is thus useless. Also, you are not even using it. I would just remove it (and make execute
public if you need to).
I think that you should fix the SQL injection issue before the rest of the code is reviewed, as it will change in a lot of places.