Post a message
require "message" def do_post_page(cgi) mstore = get_message_store user = get_session(cgi)['user'] num = cgi['id'][0] message = mstore.get_message(num.to_i) template = get_template template.gsub!(/%%HEADER%%/, header(cgi)) template.gsub!(/%%USER%%/, user) cgi.out{ template } end def get_template "<HTML><BODY> %%HEADER%% <FORM ACTION=\"/cgi-bin/rb/board.cgi\" METHOD=\"GET\"> <INPUT TYPE=HIDDEN NAME=cmd VALUE=savepost> <INPUT TYPE=HIDDEN NAME=SENDER VALUE=%%USER%%> <TABLE BORDER=0> <TR> <TD>Title:</TD><TD><INPUT TYPE=TEXT NAME=TITLE></TD> </TR> <TR> <TD>Message Body:</TD> <TD> <TEXTAREA rows=25 cols=80 NAME=BODY> </TEXTAREA></TD> <TR><TD><INPUT TYPE=SUBMIT NAME=SUBMIT></TD><TD></TD></TR> </TR> </TABLE> </FORM> </BODY></HTML>" end