in reply to Re: Printing quotes out to an html form?
in thread Printing quotes out to an html form?

Im using CGI, but the string is taken from a text file and printing to a form, not the other way around.
  • Comment on Re: Re: Printing quotes out to an html form?

Replies are listed 'Best First'.
Re: Re: Re: Printing quotes out to an html form?
by extremely (Priest) on Jan 02, 2001 at 20:39 UTC
    Well then, follow Fastolfe's second suggestion.
    use CGI; # you already have this line $q = new CGI; # and one like this to I suppose my $var = "some text from a file"; my $varesc = $q->escapeHTML($var);

    --
    $you = new YOU;
    honk() if $you->love(perl)

Re: Re: Re: Printing quotes out to an html form?
by cianoz (Friar) on Jan 02, 2001 at 21:07 UTC
    well, if you are using CGI.pm then why not use the textfield method? it escapes html for you (it uses the escapeHTML() method internally):
    use CGI; my $q = new CGI; my $value = '<img src="/someimg.gif">'; print $q->start_html(), $q->start_form(), $q->textfield( -name=>'test', -value=>$value), $q->end_form, $q->end_html;
    it works great!