Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Need to know the process to implement perl script into web application server.

by perlfan (Vicar)
on Mar 29, 2021 at 21:41 UTC ( [id://11130558]=note: print w/replies, xml ) Need Help??


in reply to Re^2: 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.

There are a number number of ways to send a request to the server that allows you to use any combination of form elements or request parameters. So it depends on what you want.

Some options, depending on the user experience you want to provide (no judgements here about what's better for your situation due to lack of details):

"old school" - (no JavaScript) necessarily reloads a page or URL in the web browser (either same page or in a new tab or window)

  • direct link to the static file
  • an actual download link that sends a GET request (via traditional hyperlink "click") to an endpoint (URL) that has the paramaters baked into the URL itself, that then invokes your business logic on the server to return whatever file you wish
  • traditional HTML <form></form> with "radio" buttons, which when it is submitted sends a GET or POST ("method") request to the "action" with the form element values; then results in the browser loading the "action" URL - this could be the same "page" or a different "page" altogether

"modern" - requests are made in the "background" (asynchronously) and the page the user is on doesn't "reload" (requires JavaScript)

  • form with radio buttons (or other elements), but "submit" issues the asynchronous request via JavaScript; the page is not reloaded
  • a hyperlink, where "onclick" triggers the async JavaScript request

Depends on what you what. The general answer to, can it be done, is yes. Best for you to decide how you want the user to interact with the page and what you want them to "see" when whatever kind of element you want is clicked - hyperlink, form "submit" button, dog picture, etc. Decide that and you might get some much better information.

  • Comment on Re^3: Need to know the process to implement perl script into web application server.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130558]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-26 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found