Skip to content

Examples: 001-SimpleWeb POST form demo (GET + POST parity) #259

Description

@PurHur

Problem

examples/001-SimpleWeb/example.php documents POST in the file header but only reads $_GET['name']. Manual testers and #248 ServeTest need a minimal POST path in the shipped example tree without waiting for #3-MiniWebApp.

Goal

Same page accepts:

  • GET /example.php?name=Dev (current)
  • POST /example.php with name=Dev in body

Scope

  • Branch on $_SERVER['REQUEST_METHOD'] or use $_REQUEST['name'] with documented semantics
  • Update example header comments and examples/README.md curl recipes
  • Extend ExamplesCompileTest::vmExtraArgs / smoke needles if output changes
  • Optional: small HTML <form method="post"> for browser manual test

Acceptance criteria

./phpc serve 127.0.0.1:8080 examples/001-SimpleWeb
curl -s -X POST -d 'name=PostDev' 'http://127.0.0.1:8080/example.php' | grep 'Hello PostDev'

VM and serve path match stock PHP 8 behavior for urlencoded POST.

Verification (local only)

make web-smoke
./script/ci-local.sh --filter ExamplesCompileTest

Do not require GitHub Actions.

Dependencies

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions