Problem solved many thanks to Chrisf and Zaxo for their help in the chatterbox with this... here is what i (with the help of those mentioned above, remember if your in my nect of the woods cookies will be yours) did. #1 I changed the redirect statemnt to contain the full URL so it looks like this
print redirect("http://www.awebserver.com/cgi-bin/~whereyouneedtogo.pl +?username=$un");
2.I also changed the way I was evaluating the params passed to the script the redirect was calling. Now they evaluate before.It is questionable if this was needed or not but it makes the code a little cleaner. 3. And here is the big fix. If you look closley the script was already sending info back to the browser when the redirect was called. this dosent work.... so i changed it now that whole section of code. Now it looks like this:
sub char_handler { my ($expat, $text) =@_; if ($::flag==1 && $text eq (param("username"))) { $::flag=1; } if ($::flag==2 && $text eq (param("password"))) { my($un); $un=param("username"); print redirect("http://www.domain.com/cgi-bin/xml_final/vie +wdb.pl?username=$un"); } elsif ($::flag==2 && $text ne (param("password"))) { $::flag=0; print header; print start_html(-title => "Not so much correct with tha lo +gin" ,-style => { -src => "../..//xml_final/db.css"}); print h1("incorrect password"); print p({-align=>'CENTER'},a{-href=>"login.pl"},"Try Agian? +"); print end_html; #print a link back to login.pl } }
Nifty huh? If you wondering what the script actually does. it is taking usernames and passwords from an xml file and validating them agianst what was entered in the web browser... this is a first run at it. If anyone wants to suggest impovements pelase feel free.

In reply to Re: A CGI redirect problem by krujos
in thread A CGI redirect problem by krujos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.