HomebaseWorks

PHP web application questions

Questions about how a PHP app is put together, from request to response.

EWritten by the HomebaseWorks editorial team · reviewed 26 Oct 2026
1
Describe what happens when a form is submitted to a PHP page.

The browser sends a POST request; PHP fills $_POST; the script validates, acts (often a prepared INSERT), and either redirects (Post/Redirect/Get) or renders a response.

2
Why redirect after a successful POST?

So a refresh does not resubmit the form and create a duplicate record. Redirect to a GET page that shows the result.

3
What is the difference between include and require?

Both pull in a file. require stops the script if the file is missing; include only warns. Use require for files the app cannot run without.

Advertisement
4
How do sessions work?

session_start() reads a session id from a cookie, loads that user's data into $_SESSION, and saves it at the end of the request. Regenerate the id on login.

5
What is MVC and why do frameworks use it?

Model (data), View (templates), Controller (request handling). It keeps database code out of HTML and makes each part testable. Laravel and Symfony follow it.

6
How would you store a password?

Never in plain text. Use password_hash() to store and password_verify() to check. The hash includes its own salt.

Practise out loud. Say each answer once as written, then again in your own words with your own number or story.

Have a number ready. "My PHP score is at benchmark on a timed test" is a stronger answer than "I am good at it". Take the test and quote the result.

Advertisement
Continue with PHP4 lessons · 2 interview sets · 1 test · 1 certificate
Not tested

More in Programming