PHP Developer

Practice & Master Your Skills

10
Exercises
5
Challenges
0
Total Points
Fill in the Blank
Code Challenges
Certificate
Exercise 1
10 pts
Start a PHP block.
echo "Hello"; ?>
Standard PHP opening tag
Exercise 2
10 pts
Access form data sent via POST method.
$name = ["username"];
Superglobal array for POST variables
Exercise 3
10 pts
Prepare and bind parameters in MySQLi.
$stmt = $conn->("SELECT * FROM users WHERE id=?");\n$stmt->("i", $id);
Prevents SQL injection
Exercise 4
10 pts
Securely hash a password.
$hash = ($password, PASSWORD_DEFAULT);
Creates a password hash using a strong one-way hashing algorithm
Exercise 5
10 pts
Start a session and set a session variable.
();\n["user_id"] = 5;
Used to manage user sessions across pages
Exercise 6
10 pts
Connect to a MySQL database.
$conn = ("localhost", "root", "", "mydb");
Function to open a new connection to the MySQL server
Exercise 7
10 pts
Sanitize output to prevent XSS.
echo ( $_POST["comment"] );
Converts special characters to HTML entities
Exercise 8
10 pts
Include a file and stop execution if missing.
"config.php";
Similar to include but produces a fatal error
Exercise 9
10 pts
Loop through an associative array.
($user as $key => $value) {\n echo "$key: $value";\n}
Provides an easy way to iterate over arrays
Exercise 10
10 pts
Redirect to another page.
("Location: login.php");\nexit;
Sends a raw HTTP header

1. Echo Variables

echo, strings

2. Form Handling

$_SERVER, $_POST

3. Session Login

session_start, heade

4. Database Query

query, fetch_assoc /

5. File Upload Check

$_FILES, UPLOAD_ERR_

Certificate Locked

You must complete the exercises with a score of 70% or higher to unlock your certificate.

0% Current Score

Claim Your Certificate

Congratulations! You have passed the required exercises. Please provide your details exactly as you want them on your certificate.

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