Greetings!
I thought I'd add a little something to a web site, a "tip of the week," and wanted it automated so that if I get hit by a truck (or, more likely, am forgetful), the tip is updated automatically.
I learned enough Perl (read: just enough) to code a script that does what I want it to do. Now the question is: how to get it to run automatically.
I would like the program to be invoked when someone, anyone, hits my homepage. I know little about our environment -- I'm not a developer -- but know that I'm on a Windows box and that we're running IIS. Server-side includes work. Perl for use with forms works. Beyond that, I must offer my apologies for my cluelessness.
I've tried to use the #exec command on my HTML page to invoke the Perl script. Doesn't work. Here's the HTML to my test page: -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-
<title>testing perl script from HTML page</title>
-
</head>
-
-
<body>
-
<!--#exec "d:/webdocs/www/irm/training/CGI/tipweek.pl" -->
-
<p>This page is to test to see whether I can run a Perl script from an HTML page.</p>
-
<p> </p>
-
<br>
-
</p><p>Other stuff on the page, including a server-side include below this line.</p>
-
<p>
-
<!--#include file="Tips/currenttip.txt" -->
-
<br>
-
</p>
-
</body>
-
</html>
-
I do not get an error message, but the files that are supposed to be updated are not updated, so something isn't happening that should be happening.
If I enter the URL for the Perl script into my browser, the script runs; the files are updated.
I don't want the Perl script to create my homepage, as I'm not the only one who needs to be able to edit the page.
Is there some relatively painless way to invoke a Perl script (which doesn't use user input and doesn't need to return anything to the page) from an HTML page?
TIA!
22 5999 KevinADC 4,059
Recognized Expert Specialist
use the virtual SSI tag instead of exec and you need to use the relative url to the script, not an internal machine path:
<!--#include virtual="../CGI/tipweek.pl" -->
see how that works
Thanks! I tried that, and get "Error processing SSI file."
I also tried <!-- #exec virtual="CGI/tipweek.pl" -->, which gives me "Invalid SSI Tag."
And "<!-- #exec "CGI/tipweek.pl" -->", which doesn't give me an error message, but also doesn't update the files.
This latter made me think it might be a files permissions problem, as I've had that problem before (a Perl script apparently running, but no changes appearing in the file that should be changed), so I wrote a little test script to write to the files, and that worked, so the permissions are fine.
I'm open to suggestions! Heck, at this point, I'm desperate for suggestions! I'm at the point where I'm ready to burn black candles and sacrifice a goat, even! Oy!!
KevinADC 4,059
Recognized Expert Specialist
I'm open to suggestions!
Check the server errror log and see if there is anything related to the script you are trying to run via the SSI tags. Probably not but it's worth a look. Post the script here if it's not too long or attach it to a post.
Thank you!!
Hi,
try -
<!-- #exec CGi="CGI/tipweek.pl" -->
-
I got "Failed to execute CGI : Win32 Error Code = 3" in response.
or -
<!-- #exec CMD="D:\webdocs\www\irm\training\CGI\tipweek.pl" -->
-
And for this, I got "The CMD option is not enabled for #EXEC calls" in response.
That banging you hear is my head against my desk!
The good thing is that the script DOES run when I enter the URL for it into the browser location. At least I have that!
I don't even know who to talk to here about this, but I guess I'm about to find out! :-D
And things aren't looking too good for the goat....!
numberwhun 3,509
Recognized Expert Moderator Specialist
I got "Failed to execute CGI : Win32 Error Code = 3" in response.
This is just a complete shot in the dark, but have you tried adding the onload="" option to your body tag in your HTML and specifying your Perl script after the equals sign in the double quotes?
ie: -
<body onload="/path/to/perl_script.pl">
-
Just a thought.
Regards,
Jeff
KevinADC 4,059
Recognized Expert Specialist
hehehe.... good try. That would be for javascript. The browser would have no clue what to do with perl code.
The OP just needs to hit on the correct SSI tag and the correct path to his perl code to get it working.
numberwhun 3,509
Recognized Expert Moderator Specialist
He he, it was worth a shot. I didn't know if it was possible or not. Oh well.
Regards,
Jeff
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Xah Lee |
last post by:
here's another interesting algorithmic exercise, again from part of a
larger program in the previous series.
Here's the original Perl documentation:
=pod
merge($pairings) takes a list of pairs, each pair indicates the
sameness
of the two indexes. Returns a partitioned list of same indexes.
|
by: Pierre-Yves |
last post by:
Hello,
I would like to prevent my perl program to be executed several times
simultaneously (if the program is already running, I would like to display a
message like "another instance of this program is already running, please
try again in a couple of minutes).
For doing this, I guess I have to check the running processes... but I don't...
|
by: SStory |
last post by:
Doing pages for contract.....
If I make an ASPX file that does certain things, how simple would it be for
a person who know nothing about it to modify the user interface without
bothering the ASPX interaction? How would I best build such pages. Many
people of course don't want a page that they can't modify at all without
programmer...
|
by: Kirt Loki Dankmyer |
last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile
it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of
different switches, but I can't get it to compile. I need it to be
compiled with threads.
Anyone have any wisdom on how best to do this?
Here's a transcript of my latest attempt. It's long; you...
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready...
| |
by: Robert Latest |
last post by:
Hello,
if HTML authoring includes HTML autogeneration, this request is on-topic.
Otherwise please forgive me and point me in the right direction.
I'd like to make a bunch of dirs full of files available on a web server. Of
course I could just leave them like they are and have the server take care
of the listings. I don't like that because...
|
by: Dan Rumney |
last post by:
Hi all,
I've been writing Javascript for quite a while now and have, of late,
been writing quite a lot of AJAX and AJAX-related code.
In the main, my dynamically generated pages are created using Perl on
the backend, with Javascript providing limited frontend functionality.
As an example, an expanding tree would be fully populated on the...
|
by: happyse27 |
last post by:
Hi All,
I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c.
Not sure where went wrong as the web page displayed internal server error.
Also, what is the error 543? and error 2114....
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |