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

Perl and html

by kepler (Scribe)
on Sep 05, 2015 at 00:45 UTC ( [id://1141092]=perlquestion: print w/replies, xml ) Need Help??

kepler has asked for the wisdom of the Perl Monks concerning the following question:

Good evening,

I'm trying to solve the following problem (also posted in code guru, but no answer...): I have a normal html page with a form that submits to a perl script. This last one gives an output (text or html).

I want to reload the exact same first html page with the results of the script in a span, ul, or whatever...

Any ideas?...

Regards,

Kepler

Replies are listed 'Best First'.
Re: Perl and html
by wjw (Priest) on Sep 05, 2015 at 00:57 UTC

    Have the script deliver the original html page, then return both the original page and the results back to the client using whatever formatting you want. You can tell whether it is an initial load or a form submit when your script receives the request...

    ...one of many ways.. Hope that is helpful.

    ...the majority is always wrong, and always the last to know about it...

    A solution is nothing more than a clearly stated problem...

      Hi,

      That was my original idea. But the problem is the page html menu links. The html page and the script are in diferent locations...which is a mess...How c

      an I give back the html page in the right place?...

        Hi, That was my original idea. But the problem is the page html menu links. The html page and the script are in diferent locations...which is a mess...How can I give back the html page in the right place?...

        :) So now you know what you have to fix, fix the links

        Several approaches, mostly, have the original page simply call / redirect / link to the "program", and have the program present all the html with all the links fixed

Re: Perl and html
by Anonymous Monk on Sep 05, 2015 at 13:13 UTC

    The OP's question is cross posted on perlguru. http://perlguru.com/gforum.cgi?post=82016;#82016
    Where I gave this answer.

    Sounds like your form should be executing the perl script via an AJAX call which then updates the page.

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1141092]
Approved by 1nickt
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-19 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found