Demo mode This site is not live. It is currently being tested and developed. Nothing on here represents an offer.
← Exit course SEC-302 Website and E-Commerce Security
Course progress, 0 of 15 parts done0%

Flash cards

Download as PDF

  1. Which PHP versions can you use for this course?

    Show the answer

    PHP 8.4 or later, with the pdo_sqlite extension. On 10 November 2026 the newest releases were 8.5.12 and 8.4.27.

  2. What command starts the practice shop, and from which folder?

    Hint: Three parts: the server, the address, the web root.

    Show the answer

    php -S localhost:8000 -t public, run from the practice-shop folder. The -t public part makes public the web root.

  3. Why must PHP's built-in web server never serve a live site?

    Show the answer

    PHP's manual says it is not a full-featured web server and should not be used on a public network. It runs a single process. Module 6 plans the live server.

  4. What is the web root, and which folder is it in the practice shop?

    Show the answer

    The folder a web server hands out to browsers. In the practice shop it is public/ alone, so the code, the database and the uploads can never be fetched.

  5. What happens if you start the server in the shop folder without -t public?

    Show the answer

    The whole shop folder becomes the web root, so the database file could be downloaded. Stop it at once and start it again with -t public.

  6. How do you check that PHP can open the shop's database?

    Hint: One command lists the extensions.

    Show the answer

    Run php -m and look for PDO and pdo_sqlite in the list. Without pdo_sqlite the shop says could not find driver.

  7. On Windows, what must you change in php.ini for the shop to work?

    Show the answer

    Remove the leading character from the extension_dir line for ext and from the line extension=pdo_sqlite, so PHP loads the SQLite extension.

  8. What does the e() function do, and when is it used?

    Show the answer

    It encodes a value with htmlspecialchars, so a character such as an apostrophe or angle bracket is shown as text, never markup. Every value a page prints goes through it.

  9. Why does every query in the shop use a question mark placeholder?

    Show the answer

    The query is a prepared statement: the values travel separately from the SQL, so a value can never change the query. Module 3 explains it in full.

  10. Which requests may change something in the shop?

    Show the answer

    Only POST requests, each carrying the form token. Loading a page or following a link is a GET and only ever reads.

  11. Why does adding to the cart answer with status 303?

    Show the answer

    Post, Redirect, Get: after the form is handled, the browser is sent to the cart page with a GET, so reloading that page never sends the form again.

  12. Which settings protect the shop's session cookie?

    Show the answer

    HttpOnly (page scripts cannot read it), SameSite=Lax (left out of forms posted from other sites), Secure over HTTPS, and strict mode, which refuses session ids the shop did not issue.

  13. What does the Network tab show for each request?

    Show the answer

    Its method, address, status and type, and once you select it, the request and response headers and the response itself.

  14. What is a baseline, and why record one in Module 0?

    Show the answer

    A record of how something is now, made before you change it. Later modules, such as Module 4's security headers, can then show exactly what changed.

  15. What is a positive check?

    Hint: It says what should happen.

    Show the answer

    A check that states what a working control does and confirms it on your own shop, such as an unknown product returns 404. Never an attack.

  16. What are the shop's three Module 0 checks?

    Show the answer

    The catalogue returns 200 and lists the sample products, an unknown product returns 404, and an item added to the cart is still there on the next request.

  17. What is the rule for what you may test?

    Show the answer

    Only your own practice shop, or systems you own or have the owner's written permission to test. Unlawful access is an offence under section 2 of the Cybercrimes Act 19 of 2020.