473,750 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running a perl script from an ASP page to include QUERY_STRING

I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsear ch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
http://groups.google.com/group/micro...ae0d85395a3d72
I was recommended: "to a simple ASP page which will easily do exactly
what you want because it actually has the functionality you want, by
intention, and is supported."

That is now what I am attempting to do. I found this page:
http://www.wrensoft.com/zoom/support/faq_ssi.html
which recommends using this to run the script:
<%
Dim WshShell, env
Set WshShell = CreateObject("W Script.Shell")
Set env = WshShell.Enviro nment("Process" )
env.Item("REQUE ST_METHOD") = "GET"
env.Item("QUERY _STRING") = Request.QuerySt ring
set oExec = WshShell.Exec(S erver.MapPath(" search.cgi"))
oExec.StdOut.Re adLine() ' skip the HTTP header line
Response.Write( oExec.StdOut.Re adAll())
%>
However, when I do this, I get an error message:
WshShell.Exec error '800700c1'
docsearch.pl is not a valid Win32 application.

How can I run a perl script file, ensuring that it receives the
QUERY_STRING from the parent URL and include the output in my asp file?

Thanks
Ben

Oct 17 '06 #1
4 3755
You will have to grab the query string and call the perl script. The other
option is to call the perl script directly and have it re-direct to the
page. Which option you choose depends on your unique application needs and
the amount of interaction with the page.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
"benwylie" <be******@gmail .comwrote in message
news:11******** *************@k 70g2000cwa.goog legroups.com...
>I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsear ch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
http://groups.google.com/group/micro...ae0d85395a3d72
I was recommended: "to a simple ASP page which will easily do exactly
what you want because it actually has the functionality you want, by
intention, and is supported."

That is now what I am attempting to do. I found this page:
http://www.wrensoft.com/zoom/support/faq_ssi.html
which recommends using this to run the script:
<%
Dim WshShell, env
Set WshShell = CreateObject("W Script.Shell")
Set env = WshShell.Enviro nment("Process" )
env.Item("REQUE ST_METHOD") = "GET"
env.Item("QUERY _STRING") = Request.QuerySt ring
set oExec = WshShell.Exec(S erver.MapPath(" search.cgi"))
oExec.StdOut.Re adLine() ' skip the HTTP header line
Response.Write( oExec.StdOut.Re adAll())
%>
However, when I do this, I get an error message:
WshShell.Exec error '800700c1'
docsearch.pl is not a valid Win32 application.

How can I run a perl script file, ensuring that it receives the
QUERY_STRING from the parent URL and include the output in my asp file?

Thanks
Ben

Oct 17 '06 #2
On Oct 17, 2:10 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo... @comcast.netNoS pamMwrote:
You will have to grab the query string and call the perl script.
Can you give me some pointers on how I can "call the perl script" or
where I can find out how to do that?

On this page:
http://www.codecomments.com/message819530.html
It seems to suggest doing this:
my $returnValues = `perl somescript.pl`;
but that doesn't seem to work for me.

Any pointers as to how I can do what you have said would be helpful.
Thanks
Ben

Oct 17 '06 #3
"benwylie" <be******@gmail .comwrote in message
news:11******** *************@k 70g2000cwa.goog legroups.com...
I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsear ch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
http://groups.google.com/group/micro...ae0d85395a3d72
I was recommended: "to a simple ASP page which will easily do exactly
what you want because it actually has the functionality you want, by
intention, and is supported."
>>
I believe you have misinterpreted this advice. I think David was
suggesting you create an ASP page written with perl to do what you need.
See:

http://msdn.microsoft.com/library/de...a95b344a60.asp

I've never used perl so I will probably not be able to offer further
assistance.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Oct 17 '06 #4
Hi Ben!

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomschri eb im Newsbeitrag
news:Oq******** ******@TK2MSFTN GP02.phx.gbl...
>"benwylie" <be******@gmail .comwrote in message
news:11******* **************@ k70g2000cwa.goo glegroups.com.. .
I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsear ch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
I had the same problems a few weeks before.
ASP doesn't support most of the SSI commands, AFAIL only the "include"
command.

IU solved my problem using the hints on the article "How do I read the
contents of a remote web page?"
from
http://classicasp.aspfaq.com/general...-web-page.html .
Eventually you have to install the "MSXML and XML Core Services" described
in the article.

After installation I had only add a few lines like:

<%
url =
"http://<myhosturl>/cgi-bin/counter/Counter.pl?Sile nt=1&CntName=<m yCountername>"
set xmlhttp = CreateObject("M SXML2.ServerXML HTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.Write xmlhttp.respons eText
set xmlhttp = nothing
%>

to include a perl based counter called from the asp page including the given
GET params.

HTH,

Ralf

Oct 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5082
by: Sandman | last post by:
The subject says it all. I am doing a: I have a perl script in which I am using a ReadParse routine that parses the $ENV{'QUERY_STRING'} or $ENV{'CONTENT_LENGTH'} which are two variables passed to the script under usual SSI (.shtml) containing form data submitted to the page from which the script is executed from. Well, since switching to PHP, I have moved most of my perl scripts to php equivalents, but there are a few perl scripts...
1
2057
by: rk | last post by:
Hi, I'm trying to write a cgi/perl programs to post a report like the following format in which the the user has to feed the values(nos) in the boxes under % Done Qual Rel. Stab P1 p2 P3.... and boxes under
6
15900
by: Richard Trahan | last post by:
I want a js function to call a Perl script residing on a server. The Perl script will return a string, to be used by the js. Pseudo code: <script> stringvar = perlfunc_on_server(stringarg) document.write(stringvar) </script> Can stringvar above be a url?
4
4155
by: jonniethecodeprince | last post by:
Greetings all. I have a problem with PERL and SQL Server. I need to upload a database query to a web page using PERL and SQL Server. I have tried to do this myself but nothing displays on the page. The .CGI file will call the PERL but does not display any of the results of the query search via SQL Server on my page. I have commented out the output I wanted because this causes an Internal Server Error. I realise that this is a very basic...
10
1399
chunk1978
by: chunk1978 | last post by:
hi everyone... i've recently noticed some strange .php scripts that are automatically added to some folders on my server... this one is called "47481.php" <? error_reporting(0);$s="e";$a=(isset($_SERVER) ? $_SERVER : $HTTP_HOST);$b=(isset($_SERVER) ? $_SERVER : $SERVER_NAME);$c=(isset($_SERVER) ? $_SERVER : $REQUEST_URI);$d=(isset($_SERVER) ? $_SERVER : $PHP_SELF);$e=(isset($_SERVER) ? $_SERVER : $QUERY_STRING);$f=(isset($_SERVER) ? $_SERVER...
6
2135
saranjegan
by: saranjegan | last post by:
Hello, Though i can make my script work well with perl , when am supposed write a script in C its giving error named 500 internal server error i have even tried with some example programs from net am getting the same error from error log i found its Premature End Of script headers ,while am trying it run on mozila browser it just asking for the download of the exe file, am posting the code below HTML code : <HTML> <Head> <title>Test...
10
6975
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. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
15
3480
by: JWest46088 | last post by:
Hi. I need to create 3 pages. Page 1 requests the number of elements the user wants to add and average. Page 2 asks the user for the numbers. Page 3 adds and averages the numbers and displays them. I can't create a separate page 3 to do this. Page 3 shows the contents of page 2 in addition to the contents of page 3. How do I get only the contents on page 3 to display separately? Everything works so I'm just asking how to do this. Any...
0
9001
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9396
jinu1996
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8263
agi2029
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6808
isladogs
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6081
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3323
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.