Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: CGI form 'falls through' without capturing anything

by choroba (Archbishop)
on Jan 10, 2017 at 21:31 UTC ( #1179357=note: print w/replies, xml ) Need Help??

in reply to CGI form 'falls through' without capturing anything

What part of the code implements "get the user's response"? Do you understand how HTTP and CGI work?

The CGI code runs on the server and generates the page, the client (a browser) interprets that and shows it to a user. Running a subroutine on a server doesn't wait for user input. You need a different page for the Captcha, or implement it in JavaScript.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: CGI form 'falls through' without capturing anything
by chexmix (Hermit) on Jan 11, 2017 at 19:32 UTC
    "Do you understand how HTTP and CGI work?"

    This really is the key, of course. I didn't. When I started work on this I thought 'as long as I don't try to do anything the rest of the program isn't trying to do, I'll be okay', but that has turned out not to be the case at all.

    I queried a much more experienced friend on this and now have a better understanding of CGI; however, I am now uncertain how to solve the problem at all.

    I can make the desired 'captcha' image display correctly on the first of a number of screens. However, I don't know how to have the generated captcha object 'persist' to a 'place' where I can run the check of the user's guess against it: I can't shove it into a hidden field -- or at least I don't know how to correctly. So after the user hits submit on that first screen, I have the user's input in a parameter, but the generated captcha object is gone.

    I'd write more but I'm practicing succinctness. :)

    UPDATE: problem solved. It was a stupid problem, having nothing to do with making objects persist -- but everything to do with making my cool headspace persist so I don't miss stupid things. Thanks!!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1179357]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2022-10-06 20:39 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (28 votes). Check out past polls.