in reply to Re^16: Need to know the process to implement perl script into web application server.
in thread Need to know the process to implement perl script into web application server.

webapp.pm
package webapp; use Dancer2; my %common = (title => 'webapp'); get '/' => sub { template index => { %common }; }; post '/' => sub { if (body_parameters->get('Users-list') eq 'Users-list' ) { template index => { %common, button => 'Users-list' } } elsif (body_parameters->get('Apps-list') eq 'Apps') { template index => { %common, button => 'Apps-list' } } }; true;
index.tt
[% IF button %] <p>You pressed [% button %].</p> [% ELSE %] <form id="f1" method="post" action="/"> <div> <input type="radio" name="OKTAUsersList"> <label for="OKTAUsersList">OKTA-Users-List</label> <label for="Email">Recipient Email</label> <input id="email" name="Email"> <input type="submit" name="Users-list" value="Users-list" /> </div> <div> <input type="radio" name="OKTAAppsList"> <label for="OKTAAppsList">OKTA-Apps-List</label> <label for="Email">Recipient Email</label> <input id="email" name="Email"> <input type="submit" name="Apps-list" value="Apps" /> </div> </form> [% END %]
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.