in reply to Re: Re: CGI parsing difficulty
in thread CGI parsing difficulty

Anyhow, if I hit http://localhost/myscript.pl?text=I+LOVE+MY+WIFE then it works. Going through a web form which then writes <img src="/myscript.pl?$text"> ($text being pulled by $text = $q->param("text") ) then it only prints the first letter, the I.
You are properly URI-escaping the code you print in $text, right? You can't just do this:
print qq{<img src="/myscript.pl?$text">};
because you need to re-percentify or plusify spaces, etc etc., as in:
use URI; my $uri = URI->new("/myscript.pl"); $uri->query($text); my $uri_string = $uri->as_string; print qq{<img src="$uri_string">};

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Re: CGI parsing difficulty
by tame1 (Pilgrim) on Nov 22, 2000 at 21:38 UTC
    Randall, this worked fine with one exception:

    I had to replace $uri->query with $uri->query_form($key=>$text)

    As it stands I also had to replace the imager.cfm with an imageform.cgi,
    as there was no way to force Cold Fusion to clean up the
    string before calling the image maker.(At least not a method
    that I am aware of yet.)

    Thanks for all the help, everyone!

    What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"
Re: Re: Re: Re: CGI parsing difficulty
by tame1 (Pilgrim) on Nov 22, 2000 at 03:03 UTC
    Well CRAP!!

    Finally someone has the answer!!

    Thanks Merlyn. Too bad all my votes for today are gone ;-)

    What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"