$Log$
+ Revision 1.21 2003/11/25 04:01:44 ajc
+ * Completed "post" and "post html" stuffs
+
Revision 1.20 2003/11/22 04:33:22 ajc
* fleshed out the message headers a bit
Revision 1.1 2003/10/31 03:47:13 ajc
* Initial CVS import
+
//
function text_to_server($thetext, $convert_to_html) {
+ // HTML mode
+ if ($convert_to_html) {
- $this_line = strtok($thetext, "\n");
+ // Strip CR's; we only want the LF's
+ $thetext = trim($thetext, "\r");
+
+ // Replace hard line breaks with <BR>'s
+ $thetext = str_replace("\n", "<BR>\n", $thetext);
+
+ }
+ // Either mode ... send it to the server now
+ $this_line = strtok($thetext, "\n");
while ($this_line !== FALSE) {
$this_line = trim($this_line, "\n\r");
if ($this_line == "000") $this_line = "-000" ;
$this_line = strtok("\n");
}
- serv_puts("000");
+ serv_puts("000"); // Tell the server we're done...
+
serv_puts("ECHO echo test."); // FIXME
echo "Echo test: " . serv_gets() . "<BR>\n" ;
include "ctdlheader.php";
bbs_page_header();
- serv_puts("ENT0 1");
+ serv_puts("ENT0 1||0|4|");
$response = serv_gets();
if (substr($response, 0, 1) != '4') {
echo htmlspecialchars(substr($response, 3)) . '<br>' ;
}
else {
+ serv_puts("Content-type: text/html");
+ serv_puts("");
text_to_server($_REQUEST["msgtext"], TRUE);
}