<! graffitiwall.html>
<title>Graffiti Wall</title>
<body bgcolor="#ffffff">
<center>
<h2>Graffiti Wall</h2>
</center>
<hr>
<!--#neoscript code='

load_response response

set datafile graffitiwall

proc main {} {

	global webenv datafile response

	set fp [access_data_file $datafile]
	
	while {[gets $fp line] >= 0} {
		html $line<br>
	}	

	html "<hr>"
	neo_form response {method="post" action="graffitiwall.html"}
	neo_form_field hidden mode "value=action"
	neo_form_radiobuttons function checked "Append"
	neo_form_radiobuttons function unchecked "Wipe"
	html "<br>"
	neo_form_textarea graffiti "rows=5 cols=60"

	html "<BR>"
	neo_form_submit
	
	neo_form_end
}

proc action {} {

	global webenv datafile response

	if {[string compare $response(function) Wipe] == 0 } {
		delete_data_file $datafile
		return
    	}

	set fp [access_data_file $datafile]

	seek $fp 0 end

	puts $fp "<hr><b>On [clock format [clock seconds]], someone near <i>[remote_hostname]</i> wrote:</b>"
	puts $fp $response(graffiti)
	close $fp

	neo_form response {method="post" action="graffitiwall.html"}
	neo_form_field hidden mode "value=main"
	neo_form_submit
	neo_form_end
}

if {![array exists response]} {
	main
} elseif {[string compare $response(mode) main] == 0} {
	main
} elseif {[string compare $response(mode) action] == 0} {
	action
}
'-->

</BODY>
</HTML>



