Rename and update to server
[EroTweet.git] / add-to-queue.php
blob6ebda3968fab1d3d0742dd9a2fa3a5bacc99ceda
1 <?php
2 require("class/queue-database-construction.php");
3 $construction = new QueueDatabaseConstruction();
4 $halt_check = $construction->getPostDetails("SubmissionHalt", "IPAddress", $_SERVER['HTTP_X_REAL_IP']);
5 if(sizeof($halt_check) == 0){
6 $construction->addToTable("SubmissionHalt", array("IPAddress"=>$_SERVER['HTTP_X_REAL_IP']));
7 $comment = $construction->checkCommentValid($_POST["comment"]);
9 $file_string = $construction->uploadAndVerify($_FILES);
11 $do_not_submit = false;
12 //Duplicate code = 5
13 for($file = 0 ; $file < 4 ; $file++) if($construction->die_state[$file] != -1 && $construction->die_state[$file] != 4){
14 $do_not_submit = true;
16 if( $construction->comment_error == 0) $do_not_submit = true;
18 if($do_not_submit) {
19 header("location: /twitter/confirmation.php?" . "comment=" . $construction->comment_error
20 . "&f1=".$construction->die_state[0]
21 ."&f2=". $construction->die_state[1]
22 ."&f3=". $construction->die_state[2]
23 ."&f4=".$construction->die_state[3]);
25 else $construction->addToTable("TweetQueue.php", ["ImageLocation" => $file_string, "Comment"=>$comment]);
26 header("location: /twitter/confirmation?" . "comment=" . $construction->comment_error
27 . "&f1=".$construction->die_state[0]
28 ."&f2=". $construction->die_state[1]
29 ."&f3=". $construction->die_state[2]
30 ."&f4=".$construction->die_state[3]);
32 else
33 header("location: /twitter/confirmation?errmsg=1");