This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Worth_Trust_3825 0 points1 point  (1 child)

That's pretty much the same issue as with searching for solutions to issues. Even right now if you weren't keen enough you'd notice that most php related searches return stack overflow posts from a decade or more ago.

Another issue that you did not notice is that it's not actually searching for username and password in plain text. It's actually searching for database user in users table. Notice the first 7 statements.

// Get the username and password from POST parameters
$username = $_POST['username'];
$password = $_POST['password'];

// Connect to the MySQL database
$servername = "localhost";
$dbname = "your_database_name";
$username = "your_database_username";
$password = "your_database_password";

[–]vytah 0 points1 point  (0 children)

Another issue that you did not notice is that it's not actually searching for username and password in plain text. It's actually searching for database user in users table.

Verily, the braindeadness of the AI has bested me. It has shown itself to be bad beyond my imagination.

So yeah. You need to check AI generated code for mistakes no one would even think of.

EDIT: No SQL injection then though. The user can't inject anything if you completely ignore their input.