WoodShedd
09-07-2003, 11:58 PM
I had the following script working some time ago, but today when I went to set it up again, it would not work
I get no error messages, and the script will not write to file that which is input through the form.
in short I really am stumped, and any help at all would be extremely welcome :)
Thanks
<?ob_start();
define('FILENAME','/var/www/html/reglist.dat');
define('IPLOG','/var/www/html/iplog.dat');
define('FREQ', 30);
define('REDIR','http://site.com/thankyou.html');
$diff = time() - @filemtime(FILENAME);
if ($diff < FREQ) die('You may only submit a form once in 30 seconds.');
if ($errors)die('An error occured while processing your input.');
$s = sprintf("%s|%s|0\n",$_POST['username'],$_POST['password']);
$s2 = sprintf("%s -- %s\n",date('r'),$_SERVER['REMOTE_ADDR']);
$fd = fopen(FILENAME,'a+');
fputs($fd,$s); fflush($fd); fclose($fd);
$fd2 = fopen(IPLOG,'a+');
fputs($fd2,$s2); fflush($fd2); fclose($fd);
header('Location: '.REDIR);
ob_end_flush();
?>
I get no error messages, and the script will not write to file that which is input through the form.
in short I really am stumped, and any help at all would be extremely welcome :)
Thanks
<?ob_start();
define('FILENAME','/var/www/html/reglist.dat');
define('IPLOG','/var/www/html/iplog.dat');
define('FREQ', 30);
define('REDIR','http://site.com/thankyou.html');
$diff = time() - @filemtime(FILENAME);
if ($diff < FREQ) die('You may only submit a form once in 30 seconds.');
if ($errors)die('An error occured while processing your input.');
$s = sprintf("%s|%s|0\n",$_POST['username'],$_POST['password']);
$s2 = sprintf("%s -- %s\n",date('r'),$_SERVER['REMOTE_ADDR']);
$fd = fopen(FILENAME,'a+');
fputs($fd,$s); fflush($fd); fclose($fd);
$fd2 = fopen(IPLOG,'a+');
fputs($fd2,$s2); fflush($fd2); fclose($fd);
header('Location: '.REDIR);
ob_end_flush();
?>
