The Author field has not been completed.\r\n"; if (strlen($title) < 4) $errors .= "\t
  • The Title field has not been completed.
  • \r\n"; if ($HTTP_POST_FILES["upload"]["error"] == 4) { $errors .= "\t
  • No file was specified for upload.
  • \r\n"; } elseif ($HTTP_POST_FILES["upload"]["type"] != "application/x-shockwave-flash") { $errors .= "\t
  • The file specified for upload does not seem to be of the correct type. A Shockwave Flash file (.SWF) is expected."; } if ($errors) { echo "

    The following error/s resulted in an unsuccessful upload:

    \r\n\r\n\r\n\r\n"; } else { # Ascertain a unique filename for the uploaded file. $fileName = $HTTP_POST_FILES["upload"]["name"]; if (file_exists($fileName)) { for($iter = 1; file_exists(basename($fileName, ".swf") . "_$iter.swf"); $iter++); $fileName = basename($fileName, ".swf") . "_$iter.swf"; } #Copy the file into the folder. if (!copy($HTTP_POST_FILES["upload"]["tmp_name"], $fileName)) { echo "

    The server did not successfully copy the file into the required directory.

    \r\n\r\n"; } else { if ($dataHandle = @fopen("tutorial_data.txt", "a")) { fwrite($dataHandle, "$fileName\r\n" . $_POST["title"] . "\r\n" . $_POST["author"] . "\r\n" . date("Ymd") . "\r\n" . $_POST["resolution"] . "\r\n"); fclose($dataHandle); echo "\r\n\r\n

    The upload was successful.

    \r\n\r\n"; } else { echo "

    The upload was successful, but the tutorial data file could not be modified to add the tutorial to the list. Please contact Alex with the details of your tutorial.

    \r\n\r\n"; } } $displayForm = false; } } if ($displayForm) { ?>

    Location of Flash tutorial on your computer:

    Title:

    Author:

    Resolution:

    Please do not upload tutorials with a resolution greater than 1024x768; it will greatly reduce its usability for most users.