Revived Vulnerable PHP User Registration

By: fyvo July 22, 2025 PHP

Description

This ancient PHP script handles user registration, demonstrating severe security flaws and outdated practices. It was likely part of a forgotten web application from the early 2000s.

Code Snippet

<?php
$username = $_POST['username'];
$password = $_POST['password'];
$conn = mysql_connect('localhost', 'dbuser', 'dbpassword');
mysql_select_db('mydb', $conn);
$sql = "INSERT INTO users (username, password) VALUES ('$username', '$password')";
mysql_query($sql, $conn);
mysql_close($conn);
?>

Discussion (0)