msinfo has asked for the wisdom of the Perl Monks concerning the following question:

Testing web page: http://mypage/ contains 3 divs. One div has search form, and div shows content based on search term, and third one is useless for now.

When I enter query term, say apple in form, it calls to PERL CGI web page: http://mypage/cgi-bin/test.pl. This CGI script goes through Access DB and returns results, in second div.

But now when I enter a search term apple again, it doesn't shows any results, instead third div gets floated towards left side. I can't understand why POST method fails on page  http://mypage/cgi-bin/test.pl which runs proper while on http://mypage/page.

Replies are listed 'Best First'.
Re: PERL CGI Form Processing while URL change
by ww (Archbishop) on May 10, 2013 at 20:28 UTC
    "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!

      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.