This script takes a post from post.htm to this file room1no.php3 and sends the results to a text file for further use. I don't wish to keep the "FORM IS BLANK" case if nothing is entered - I want it just to post all the same. I keep getting errors when I try to edit lines out. Would anybody with a little patience take the time to comment out // the appropriate lines?
thanks
Robert
<script language="php">
$PostPage = "post.htm";
$gbno1Page = "index.php3";
if ($room1no == ""):
$error1 = "FORM IS BLANK";
echo $error1;
include($PostPage);
elseif ($form == preview):
echo("
<head>
<title>Untitled</title>
</head>
<style type='text/css'>
<P><font size='3' class='s4'>Confirm your additions/replacements and submit</P>
<FORM ACTION='room1no.php3' METHOD=POST>
<INPUT TYPE=text NAME=room1no SIZE=20 maxlength=50 value=$room1no><BR>
<INPUT TYPE=submit NAME=gbno1 VALUE='Add Entry'></FONT>
</FORM></P>
</BODY>
");
else:
$gbno1File = "room1no.txt";
$gbno1Page = "index.php3";
$page = $gbno1File;
$filename = "room1no.txt";
$fd = fopen($filename, "w");
$current = fread($fd, filesize( $filename ));
fclose($fd );
$fileMessage .= "$room1no";
if (file_exists("$page")):
$cartFile = fopen("$page","w");
fputs($cartFile,$fileMessage);
fclose($cartFile);
else:
$cartFile = fopen("$page","w");
fputs($cartFile,$fileMessage);
fclose($cartFile);
endif;
include($gbno1Page);
endif;
</script>