http://www.perlmonks.org?node_id=1033028


in reply to PERL CGI Form Processing while URL change

"third div gets floated towards left side"

Check your css. Check your markup. Smells as though you have problems with one or both of those.

AND IN ANY CASE, the Monastery's crystal ball has been broken for a long time, so we sometimes fail to offer relevant suggestions to problems for which neither code nor spec is shown.


If you didn't program your executable by toggling in binary, it wasn't really programming!

Replies are listed 'Best First'.
Re^2: PERL CGI Form Processing while URL change
by msinfo (Sexton) on May 10, 2013 at 20:40 UTC
    Thanks, but CSS is not my main concern. Below is code of form present on http://localhost
    <form action="http://localhost/cgi-bin/env.pl" method="POST"> <input id="q" type="text" size="15" name="query" value="" /> </br> <input type="submit" value="Find" /> </form>

    This form method works fine on homepage.

    But when user submits a query, and URL changes to http://localhost/cgi-bin/env.pl, the form doesn't work anymore. Page http://localhost/cgi-bin/env.pl also contains same form code as present on homepage.

    As far as I have read about Web development I know for this case Ajax, is good solution. But I want to know what wrong I did, in this case.

      Page http://localhost/cgi-bin/env.pl also contains same form code as present on homepage.

      If that were true, then it stands to reason that the 2 pages would behave the same. Since they don't, I suspect there is a difference.

        Actually code is same in both pages, for form. And what I found was, when first I make search on homepage, using same form, it give results and page/url migrates to env.pl, where same form is present, now when I search again using same form, it works an prints results. But next time, i.e second time on env.pl, it breaks.

        I also don't know what is the reason for working at first time, and not working at second time. Now, I am using cg::ajax, so now this is no problem for me, but I would like to hear some reason for it, to increase my knowledge.

        thanks for your time