Uploaded " . $_FILES["ufile"]['name'][$i] . ""; $fileCount += 1; } else { $file_msg[$i] = "Error!"; $errorLines[] = "File \"" . $_FILES["ufile"]['name'][$i] . "\" did not upload."; } } } else { $errorLines[] = "File \"" . $_FILES["ufile"]['name'][$i] . "\" was not an allowed filetype. Please upload file of type: txt, doc, pdf, html, htm, rtf, docx."; } } else { $file_msg[$i] = ""; } } if ($fileCount == 0) { $errorLines[] = "Part 1: No files uploaded."; } // part 2 Complete $text2count = str_word_count($text2_val); if ($text2count < 475 || $text2count > 525) { $errorLines[] = "Part 2: Submission not between 475 and 525 words. (" . $text2count . ")"; } // part 3 Complete $text3count = str_word_count($text3_val); if ($text3count < 475 || $text3count > 525) { $errorLines[] = "Part 3: Submission not is not between 475 and 525 words. (" . $text3count . ")"; } // part 4 Complete? // part 5 Complete? $text5count = str_word_count($text5_val); if ($text5count > 0 && ($text5count < 475 || $text5count > 525)) { $warningLines[] = "You have entered text for OPTIONAL Part 5, but it is not between 475 and 525 words. (" . $text5count . ")"; } // part 6 Complete? $text6count = str_word_count($text6_val); if ($text6count > 0 && ($text6count < 475 || $text6count > 525)) { $warningLines[] = "You have entered text for OPTIONAL Part 6, but it is not between 475 and 525 words. (" . $text6count . ")"; } // privacy box checked? if ($_POST["privacy"] != '1') { $errorLines[] = "You did not check the box stating you understand this information will be published publicly."; } # FINISH SUBMISSION IF NO ERRORS if (count($errorLines) == 0) { $filename = "uploads/" . strval($uid) . "-" . strval($amazon_id) . "_submission.txt"; if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, strval($uid)) === FALSE) { echo "Cannot write to file ($filename)"; exit; } else { fwrite($handle, "\n\nPart 2:\n\n"); fwrite($handle, $text2_val); fwrite($handle, "\n\nPart 3:\n\n"); fwrite($handle, $text3_val); fwrite($handle, "\n\nPart 4:\n\n"); fwrite($handle, "Age: " . $_POST["age"] . "\n"); fwrite($handle, "Language: " . $_POST["language"] . "\n"); fwrite($handle, "Gender: " . $_POST["sex"] . "\n"); fwrite($handle, "Education: " . $_POST["education"] . "\n"); fwrite($handle, "Occupation: " . $_POST["occupation"] . "\n"); fwrite($handle, "Background: "); if ( isset($_POST["background"]["Machine Learning"]) ) { fwrite($handle,"Y,"); } else { fwrite($handle,"N,"); } if ( isset($_POST["background"]["Security"]) ) { fwrite($handle,"Y,"); } else { fwrite($handle,"N,"); } if ( isset($_POST["background"]["Linguistics"]) ) { fwrite($handle,"Y,"); } else { fwrite($handle,"N,"); } if ( isset($_POST["background"]["Computer Science"]) ) { fwrite($handle,"Y,"); } else { fwrite($handle,"N,"); } if ( isset($_POST["background"]["Literature"]) ) { fwrite($handle,"Y"); } else { fwrite($handle,"N"); } fwrite($handle, "\n\nPart 5:\n\n"); fwrite($handle, $text5_val); fwrite($handle, "\n\nPart 6:\n\n"); fwrite($handle, $text6_val); fwrite($handle, "\n\nPrivacy Check: " . $_POST["privacy"] . "\n\n\n"); $submissionComplete = 1; } fclose($handle); } } #echo $uid ?>
Analyzing Authorship Recognition TechniquesMichael Brennan, Sadia Afroz, Rachel Greenstadt. Drexel University |
Thank you for your submission. Your participation is appreciated. Please check psal.cs.drexel.edu for updates on the project. 0): ?>