Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi and windows. help. can't run the script. 1

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
why can't i run cgi right off the desk top?

can anyone step by step me to making this possible?


-crispy
 
In order to run cgi scripts on your desk top you need to be running some sort of web server. MS has a personal web server that might do the trick, or perhaps others have better suggestions. I think there's even a thread already that talks about how to set up a web server on your local pc.

Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
You can run CGI off the desktop, but not through a browser, since the CGI output goes to STDOUT, and browsers don't deal with STDOUT directly on the local machine. If you're willing to enter your key=value pairs from the console, you can run perl CGI from the command line, but your output will be raw HTML (or whatever).

Alternately, you can install a web server on your local machine as tsdragon recommends. That is probably an easier choice to do design, but debugging probably is better done from the console.

Share and Enjoy!
 
Good point obscurifer. It does work that way. I just never liked doing it that way.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
"I think there's even a thread already that talks about how to set up a web server on your local pc."

A thread? There's thousands. :)

Try the Apache forum, most web people like Apache more than IIS, but thats just us.

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
thanks obscurifer...i don't understand whats meant by key=pairs and the console...very new to this, just started perl...

help anyone?


-crispy

knows: people that know javascript, perl, c++, mike
 
When I said there was already a thread, I meant HERE. I know there a lots of other places to go too, but WE are the most helpful, aren't we?
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
<grin> hi Tracy -- modest as ever <grin> Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Crispy,

What Obscurifer meant is that you run the script from a Command Prompt (well, I do anyway) and for every variable you want to have filled in, you have to give it a key (variable name) and it's corresponding value in the form of key=value

For example, Let's say I want to have a script gather someone's first and last name and their e-mail address for my mailing list. When you run the program from the command line, you'll get a message that says

&quot;(Offline Mode: enter name=value pairs on standard input)&quot;

After this, you're cursor will be flashing and you can input your pairs (as many as you'd like or have in the script to see what happens). For this example, I'd type the following:

FIRST_NAME=Bob
LAST_NAME=Broker
EMAIL=bob@imabrokernow.com

then hit CTRL-Z to end the Standard Input and produce my results.
 
this only works if you are using the CGI module or one of it's kids (CGI::Lite, &c.). also, if you don't have any form values to be submitted, you'll just hit CTRL-Z right with no input. one thing you may find useful is to redirect STDOUT on the command line, with something like:[tt]
perl script.cgi > a_page.html
[/tt]
then view a_page.html in your browswer to see how the results look.

good luck. &quot;If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top