Running Perl Scripts

H

Hal Vaughan

Is there a way to run a Perl script WITHOUT submitting a form? I want to be
able to click an "update" button on a page and have it run a Perl script to
update info, without changing the document in the browser. Is there any
way to do that and leave the current page intact in the browser?

Thanks!

Hal
 
R

Randy Webb

Hal said:
Is there a way to run a Perl script WITHOUT submitting a form? I want to be
able to click an "update" button on a page and have it run a Perl script to
update info, without changing the document in the browser. Is there any
way to do that and leave the current page intact in the browser?

Change the source of an image to point to your Perl script. When its
requested from the server, it executes the script. Either hide the image
or have the perl script return a harmless image.
 
B

Brian Genisio

Randy said:
Change the source of an image to point to your Perl script. When its
requested from the server, it executes the script. Either hide the image
or have the perl script return a harmless image.

That is a cute way to do it... you can hide the image in a div with
visibilty turned off... I like it.

My idea is to hav a small (1x1) IFRAME that changes source.

Brian
 
R

Randy Webb

Brian said:
That is a cute way to do it... you can hide the image in a div with
visibilty turned off... I like it.

My idea is to hav a small (1x1) IFRAME that changes source.

That works, in browsers that support IFrames (Its the NN4.xx in me
coming out). Hence my suggestion for the images. Image swapping has to
be more widely supported than IFrames.
 
M

Martin Honnen

Hal said:
Is there a way to run a Perl script WITHOUT submitting a form? I want to be
able to click an "update" button on a page and have it run a Perl script to
update info, without changing the document in the browser. Is there any
way to do that and leave the current page intact in the browser?

Let your Perl script return the HTTP response code 204 and the browser
shouldn't change anything, no need for scripting.
 
H

Hal Vaughan

Martin said:
Let your Perl script return the HTTP response code 204 and the browser
shouldn't change anything, no need for scripting.

What kind of header goes on that? Do I use the HTML "Content-type:
text/html" header before sending it? (Obviously I've never used error
codes before.)

Hal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top