"; $lala = $_SERVER['REMOTE_ADDR']." - ".$_SERVER['HTTP_USER_AGENT']." - ".date('[j/F/Y:G:i:s]', time() + 28800).", "."base.swf:". $_POST['page'] . "
"; $logger = @fopen('logger.txt', 'w'); if ($logger) { fwrite($logger, $lala); fclose($logger); echo('status=OK'); } else { echo('status=' . urlencode('Could not open file for writing.')); } ; //$_POST['name'] = 'Richie Rich'; //$_POST['email'] = 'rr@rich.com'; //$_POST['comments'] = 'I am Richie Rich.'; // use foreach to loop out the values of the $_POST array foreach ($_POST as $key => $value) { // loop through the array and store the result in $received $received .= "$key = $value\r\n"; } $somethingnew1 = " Untitled Document
".$_POST['date']."
".$_POST['title']."
".$_POST['comment']."
"; $somethingnew2 = " Untitled Document
".$_POST['date']."
".$_POST['title']."
".$_POST['comment']."
"; $somethingnew3 = " Untitled Document
".$_POST['date']."
".$_POST['title']."
".$_POST['comment']."
"; // open a file for writing
// here when ever you write a new form, it will overwrite the text file. if ($_POST['page']=="1") { $printout = @fopen('example1.html', 'w'); } else if ($_POST['page']=="2") { $printout = @fopen('example2.html', 'w'); } else { $printout = @fopen('example3.html', 'w'); } // if open successful if ($printout) { // write if ($_POST['page']=="1") { fwrite($printout, $somethingnew1); } else if ($_POST['page']=="2") { fwrite($printout, $somethingnew2); } else { fwrite($printout, $somethingnew3); } // close file fclose($printout); // echo status to Flash echo('status=OK'); // open failed } else { // echo status to Flash echo('status=' . urlencode('Could not open file for writing.')); } ; ?>