in reply to Re: textareas, form scripts, line breaks etc
in thread textareas, form scripts, line breaks etc

actually, i'm already doing that, --a bit more of my code:
print "<HTML>\n<TITLE>$mb_title</TITLE>\n<BODY BACKGROUND=$bgpic BGCOL +OR=$bgcolor>\n"; print "<CENTER><FONT SIZE =+3>$mb_title<P></FONT></CENTER>\n"; print "<B>By the way, if you didn't notice, this is under construction +<BR></B>\n"; print "<TABLE BORDERCOLOR=$bordercolor BORDER=$bordersize>\n"; foreach( $msg_num = $msg_count -1; $msg_num >= 0; $msg_num--){ foreach( $i = 0; $i < @messages; $i++){ $sth = $dbh->prepare("select $messages[$i] from messages limit $ +msg_num, 1"); $sth->execute; $messageval[$i] = $sth->fetchrow_array; $sth->finish; }; $from = $messageval[0]; $date = $messageval[1]; $subject = $messageval[2]; $message = $messageval[3]; $msg_id = $messageval[4]; $message =~s/(\r\n|\n\r|\r)/<BR>\n/g; $message =~s/\n{3,}/\n\n/g; print "<TR><TD>\n"; print "Date: $date<BR>\nFrom: $from<BR>\nSubject: $subject<BR>\nMes +sage:<BR>\n$message<BR>\n"; print "<FORM METHOD='POST' ACTION='mb_post.pl'>\n"; print "<INPUT TYPE='HIDDEN' NAME='MSG_ID' VALUE='$msg_id'>\n"; print "<INPUT TYPE='HIDDEN' NAME='FROM' VALUE='$from'>\n"; print "<INPUT TYPE='HIDDEN' NAME='DATE' VALUE='$date'>\n"; print "<INPUT TYPE='HIDDEN' NAME='SUBJECT' VALUE='$subject'>\n"; $message = $messageval[3]; $message =~s/(\r\n|\n\r|\r)/\n/g; print "<INPUT TYPE='HIDDEN' NAME='MESSAGE' VALUE='$message'>\n"; print "<INPUT TYPE='SUBMIT' NAME='REPLY' VALUE='Reply'>\n</FORM>"; print "</TD></TR>\n"; }; print "</TABLE>\n"; print "</BODY>\n</HTML>\n";
I dont really have sanity checks just yet, I was gonna throw those in later, this is my first project, so i'm kinda just picking it up as I go along I'm hoping to throw in the option of html formatting(maybe even buttons for generating it), but may wind up tossing that idea out. The resulting html code (for the messages that don't show the reply button) looks like this:
<TR><TD> Date: 26 Feb 2001 23:50:30 -0000<BR> From: merlin@ethernaut.net<BR> Subject: this is a test with lynx<BR> Message:<BR> I'm testing lynx<BR> <BR> <BR> <BR> oh yeah....by the way....<BR> <BR> <BR> <BR> yamama<BR> <BR> <BR> <BR> <FORM METHOD='POST' ACTION='mb_post.pl'> <INPUT TYPE='HIDDEN' NAME='MSG_ID' VALUE='<20010302152810.22993.qmail@ +ethernaut.net>'> <INPUT TYPE='HIDDEN' NAME='FROM' VALUE='merlin@ethernaut.net'> <INPUT TYPE='HIDDEN' NAME='DATE' VALUE='26 Feb 2001 23:50:30 -0000'> <INPUT TYPE='HIDDEN' NAME='SUBJECT' VALUE='this is a test with lynx'> <INPUT TYPE='HIDDEN' NAME='MESSAGE' VALUE='I'm testing lynx oh yeah....by the way.... yamama '> <INPUT TYPE='SUBMIT' NAME='REPLY' VALUE='Reply'> </FORM></TD></TR>

Replies are listed 'Best First'.
Re: Re: Re: textareas, form scripts, line breaks etc
by Boldra (Curate) on Mar 02, 2001 at 22:16 UTC
    This is a html problem, not a perl problem. The HTML is there, it's just invalid.

    In particular, you need double-qoutes if your form values are allowed to include single-quotes:

    VALUE='I'm testing lynx..'
    needs to become:
    VALUE="I'm testing lynx"