Form Submit Question and Apache::Request

2001-12-16 Thread El Capitan

I have a form to send to a content handler and wish to use the HTML tag:

SELECT name=multi_list multiple size=4
OPTION value=1One/OPTION
OPTION value=2Two/OPTION
OPTION value=3Three/OPTION
OPTION value=4Four/OPTION
OPTION value=5Five/OPTION
OPTION value=6Six/OPTION
/SELECT

I have a handler like:

###
package testform;

use Apache::Requst;

sub handler() {
my $r = Apache::Request-new(shift);
my @list = $r-param('multi_list') || undef;

# process the list
for (@list) {
# do stuff with each selected form value
...
}
...
...
}
###


For whatever reason, I dont see the multiple values that ware selected on
the form.  Any reason why I cant collect multiple values from a form using
Apache::Request?


K




LWP Help

2001-12-14 Thread El Capitan

Hi folks, Im running an apache/mod_perl server and hope this isn't too far
off base.  I'm trying to get the following script to run against an
e-merchant system.  I've narrowed it down to the content_type and am
struggling on how to send form data via LWP::UserAgent.

I beleive all I need is to disable the
$r-content_type('application/x-www-form-urlencoded'), but dont quite
understand how to do that.  How many different content types are there and
is it possible to use the LWP object and somehow disable it?


use strict;
use LWP::UserAgent;

my $ua = new LWP::UserAgent;
$ua-agent(AgentName/0.1  . $ua-agent);

# Create a request
my $req = new HTTP::Request POST = $post;
$req-content_type('application/x-www-form-urlencoded');
$req-content(field1=$val1field2=$val2);

# Pass request to the user agent and get a response back
my $res = $ua-request($req);
my $response = $res-content;
print response:$response:\n;
#


Kirk




file upload process

2001-12-04 Thread El Capitan

Another (most likely) trivial question for the experts.
When a large file is uploaded from an html form page, it appears the file is
loaded BEFORE I can start some kind of graphical metering response:

sub handler() {
my $apr = Apache::Request-new($r);

my $upload = $apr-upload;
  my $fh = $upload-fh;
  my $lines = 0;
  while($fh) {
++$lines;
... do some return html trick stuff
  }
...
}

Before the loop through the file handle, the uploaded file has already been
loaded (I think).  Is there some way to capture the download stream (when
its actually downloading) and begin a display process back to the customer?

Thanks in advance,
Kirk




delayed file uploads...

2001-12-03 Thread El Capitan

i have a simple question.  im not sure if there is a mod_perl directive or
module for this but id like to perform this simple task:

two web pages run in sequence. the first page, id like a user to select
several files from his/her machine for uploading to the server using the
input type file tag.  when the user requests the next page, i DO NOT want
the files to immediately transfer (many reasons for this, just a hard
requirement).  rather, id like to store the names of the files into a cookie
or save it on the server with apache::session.  this part I already have
working, and am storing the file names into a tied hash using
apache::session module.

then the user moves onto the second web page and populates more form fields
with additional information.  upon submitting this second form, the files
from the previous web page (names stored in the hash %session from
apache::session) are then sent to the server.

im not sure whether or not this can be done, anyone have any clues?



Kirk




New Installation...

2001-10-16 Thread El Capitan

I'm trying to install apache 1.3.22 and modperl 1.26 and am running into
some issues.  I tried running:

perl Makefile.PL DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
APACHE_PREFIX=/mydir/apache

and everything looked ok.  Then I ran make test and got this:

...
...
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache_1.3.22/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t 
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
done
/usr/bin/perl t/TEST 0
Can't locate object method new via package URI::URL (perhaps you forgot
to load URI::URL?) at ../blib/lib/Apache/test.pm line 252.

Going to the test program shows that its making a call to URI::URL.  I have
installed URI and it is clearly in the path.  Just for kicks, I put use
URI::URL(); in the file but then it does this:

make[1]: Leaving directory `/home/thecap/mod_perl-1.26/Util'
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache_1.3.22/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t 
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
done
/usr/bin/perl t/TEST 0
still waiting for server to warm up...not ok
server failed to start! (please examine t/logs/error_log) at t/TEST line 95.
make: *** [run_tests] Error 9

The error_log file has:

[Tue Oct 16 11:26:01 2001] [crit] (98)Address already in use: make_sock:
could not bind to port 8529


Anyone have suggestions?






mod_info.c and others via libexec?

2001-10-03 Thread El Capitan

Hi folks,
I'm new to the list as well as mod_perl and have just recently loaded
Apache/mod_perl (Server Version: Apache/1.3.19 (Unix) mod_perl/1.25) and
cant find any of the modules such as mod_info.c and others which are
supposed to be in ../libexec.  In fact ../libexec is empty!  Did I do
something wrong or do I need to load them separately...
Any help would be appreciated.

Kirk