Start a PHP block.
echo "Hello"; ?>
Standard PHP opening tag
Access form data sent via POST method.
$name = ["username"];
Superglobal array for POST variables
Securely hash a password.
$hash = ($password, PASSWORD_DEFAULT);
Creates a password hash using a strong one-way hashing algorithm
Connect to a MySQL database.
$conn = ("localhost", "root", "", "mydb");
Function to open a new connection to the MySQL server
Sanitize output to prevent XSS.
echo ( $_POST["comment"] );
Converts special characters to HTML entities
Include a file and stop execution if missing.
"config.php";
Similar to include but produces a fatal error
Loop through an associative array.
($user as $key => $value) {\n echo "$key: $value";\n}
Provides an easy way to iterate over arrays
Redirect to another page.
("Location: login.php");\nexit;
Sends a raw HTTP header
Certificate Locked
You must complete the exercises with a score of 70% or higher to unlock your certificate.
ProTechSolution
Certificate of Completion
Proudly Presented To
Student Name
For successfully completing all exercises and challenges with an outstanding score in the PHP course.
Verify ID: LH-XXXX-XXXXXX