PLSQL - How to handle HTTP request on PLSQL htp generated pages?

Viewed 85

I am learning to make PLSQL web applications.

I am trying to use <form> to handle HTTP requests. But I cannot figure out how should I approach this.

This following provides an example of what I am trying to do:

set scan off;
create or replace package body local as
  -- A simple HTML form to collect client input data
  PROCEDURE P_HtpTest as
    BEGIN
      htp.p('
      <form method="POST" action="local.P_HandleCheckboxes">
        <label for="seasons">Choose season: </label>
        <select name="seasons" id="seasons" required>
          <option value="" selected disabled></option>
          <option value="winter">Winter</option>
          <option value="spring">Spring</option>
          <option value="summer">Summer</option>
          <option value="autumn">Autumn</option>
        </select>
        <button type="submit">Submit</button>
      </form>
      ');
    END P_HtpTest;

  -- Supposedly this should listen to HTTP request, I don't know how to do that in PLSQL
  PROCEDURE P_HandleCheckboxes (season IN VARCHAR2) as
    BEGIN 
    htp.p('Your season: ' || season);
      
    END P_HandleCheckboxes;
end local;

Illustration of what I get enter image description here

How should I get familiar with this? Simple directions will do. Thanks a lot!

0 Answers
Related