CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Need help on testing cgi on pc

 



kelvinraj
Deleted

Sep 21, 2000, 1:46 AM

Post #1 of 5 (4223 views)
Need help on testing cgi on pc Can't Post

I have installed active perl on my pc which is running on Win98.I am trying to test my
HTML form loaded from my brower (IE5) to
accept the input contents to a dat file on the pc. Is it possible or must i do some others settings changes?

Thanks



fashimpaur
User

Sep 21, 2000, 10:12 PM

Post #2 of 5 (4223 views)
Re: Need help on testing cgi on pc [In reply to] Can't Post

kelvinraj,

You can't do that from an html form unless you do it as a SSI if you are just trying to pre-load the form elements.

If this isn't the case, then ...

Here is my suggestion, get Apache Web Server from www.apache.org. Install it and set up a local webserver on your machine. Then run the cgi on your PC.

Or, use Perl Builder 2.0. It allows you to point to an html form and then input the data into the form and Perl Builder will process the cgi output of the script.

HTH,

Dennis


demise
Deleted

Oct 6, 2000, 12:43 PM

Post #3 of 5 (4223 views)
Re: Need help on testing cgi on pc [In reply to] Can't Post

do you have to process all form info when coming from html and going to dat or txt?
adn if so what are your thoughts on the Apache server???


dws
Deleted

Oct 6, 2000, 11:21 PM

Post #4 of 5 (4223 views)
Re: Need help on testing cgi on pc [In reply to] Can't Post

kelvinraj -- Getting CGIs working with PWS is covered in http://www.perlguru.com/forum/Forum11/HTML/000023.shtml

It works just fine, once you get it set up.


slavdaddy
Deleted

Nov 4, 2000, 2:54 PM

Post #5 of 5 (4223 views)
Re: Need help on testing cgi on pc [In reply to] Can't Post

If all you are trying to do is take the input from the form, and put it in a file, then that is pretty simple. first, make your form send the info to the perl script:

<form action='the url of your script here' method=GET>
<input name=whatever type=text>
</form>

Then parse the query string:

my $in;

if ($ENV{'REQUEST_METHOD'} eq "GET") {
$in = $ENV{'QUERY_STRING'};
}
$in =~ s/%(..)/pack("c",hex($1))/ge;
$in =~ s/\+/ /g;
$in =~ s/\&/=/g;
%formData = split (/=/, $in);
}

this puts the data in a hash. you can access it by:

$formData{'whatever you named your inputs'}.

now open a file:

open(DATFILE, '>datfile.txt');

and print to the dat file, in thsi case our data is:

print DATFILE $formData{whatever};

close the data file:

close DATFILE;

Now all of the stuff you posted is in your dat file. Hope this is what you were looking for.

-Corey

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives