Page 1 of 1

Creating Files

Posted: Sat Apr 03, 2004 12:26 pm
by robjime
I'm getting a parse error on line 3

Code: Select all

<?php
$numb = $_POST['numb']
$desc = $_POST['desc']
$filename = "$numb.htm";
$somecontent = "<html><head><title>".$numb."</title><body>".$desc."</body></html>";
   if (!$handle = fopen($filename, 'x')) {
         echo "Cannot open file ($filename)";
         exit;
   }

   
   if (fwrite($handle, $somecontent) === FALSE) {
       echo "Cannot write to file ($filename)";
       exit;
   }
   
   echo "Success, wrote ($somecontent) to file ($filename)";
   
   fclose($handle);
                   
} else {
   echo "The file $filename is not writable";

?>
its hosted at http://www.hostultra.com/~robjime/ps/newcd.htm

?>

Posted: Sat Apr 03, 2004 12:27 pm
by markl999
$numb = $_POST['numb']
$desc = $_POST['desc']

Both missing the ; on the end.