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: Advanced:
CGI::Applicaton.pm and state

 



rhizo
stranger

Oct 5, 2001, 6:37 AM

Post #1 of 2 (939 views)
CGI::Applicaton.pm and state Can't Post

this is a follow-up to my earlier post w/ 'CGI::Application'in the subject:

my application is growing big, not to mention there're a dozen versions of it to date;

it's an online catalog management system that i plan to eventually make freely available via sourceforge;

CGI::Application is a reusable cgi app framework module
available on CPAN;

actually, there're versions of my program that don't use
CGI::Application.pm, just CGI and Fcntl modules;

i have experience using/administrating Apache under Linux,
so am familiar w/ permissions, http header quirks, error logging and such, so don't need basic advice i guess..

i think, i've figured out my file upload problem, as am hacking at it nonstop ;) actually, it was more of an anon.
subroutine/filehandle problem..

send me private mess. if you'd like to see how i did it;

but my application still displays weird behaviors, eg:

i use serverside redirects, hidden <FORM> fields and serverside-prepaired javascript that gets printed to the
<HEAD> in order to maintain state and propagate certain
values, eg buttons' onclick handlers would trigger javascript functions like this one: 'function runMe(){ document.formname.action="script.cgi?runmode=runmode_name&user="+document.formname.userfield.value+"&password="+document.formname.passwordfield.value;document.formname.submit();}'

(if you see spaces between outter single quotes in javascript listing above, that's forums.perlgure.com's problem -- i ment javascript var interpolation plus signs ;) )

'runmode_name' here being the name of subroutine -- that's how my app's internal /dispatch table/ works;

misteriously, either no other 'name-value' pair shows in browser's Location field(query string) to the right of the runmode pair or even if some does show up in Location field, my application always routes to the default screen which
happens to be login screen;

hidden fields also seem to get ignored, so effectively i
can't transfer any useful params to route to the correct
subroutine and thus i can't maintain state!

now, if i manually add the appropriate name-value pairs to
the query string in the Location field of browser and hit return w/ focus in Location field or (in the case when everything shows up in the Location field) simply hit return with focus in Location field, then
everything works and i get dispatched to the correct screen,
which, while displayed properly(db manipulation would then work too), wouldn't produce correct responces if i try using the controls(buttons, selections, etc.)

among other things, i've tried flushing like so:

$| = 1; # but this doesn't seem to help..

and i think one doesn't have to flush buffers when using CGI.pm or am i wrong ?

another question:

what does

1;

at end of package do ?


perhaps someone has got any ideas as to the possible cause
of 'lasy' query string behavior described here off the top of their head ?

any suggestions much appreciated!!

i don't want to flood this forum space with lotsa code, but
hey, we could /join #perl_flood someplace irc and paste away and discuss -- i really could use a second brain or two here
;)




uwevoelker
stranger

Oct 5, 2001, 10:32 PM

Post #2 of 2 (934 views)
Re: CGI::Applicaton.pm and state [In reply to] Can't Post

Hi,
what "method" did you use in your form? (post/get)
If you want to compose a get-request, you should better use
window.location.goto('blabal.pl?runmode=show&username=max...')
[But, I don't have my JavaScript-reference-book here, please look
up the correct spelling/syntax first.]
The 1 at the end asumes a correct return code. You should use
this in every file you "require" or "use".

Good bye,
Uwe


 
 


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

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