5 <a href
="http://verniy.xyz/twitter/queue_form.html">Back to Form
</a
>
15 if(mb_strlen($_POST["comment"]) > $COMMENT_MAX){
16 echo "Comment too long-Server<br/>";
28 for($file = 1; $file <= 4; $file++
){
29 $upload_location = "images/" . basename($_FILES["file" . (string)$file]["name"]);
30 if($_FILES["file" . (string)$file]["error"] == 0 && $upload_location !== "images/" && $_FILES["file" . (string)$file]["size"] < $FILE_MAX){
31 $file_arr[$file - 1] = $upload_location;
33 $file_string .= rawurlencode($upload_location);
37 $file_string .= "," . rawurlencode($upload_location);
39 echo "$upload_location<br/>";
41 if (move_uploaded_file($_FILES["file" . (string)$file]["tmp_name"], $upload_location )) {
42 echo "File is valid, and was successfully uploaded.\n";
45 echo "file" . (string)$file . " Upload Error <br/>";
46 $file_arr[$file - 1] = "0";
51 echo 'Here is some more debugging info: <br/>';
52 print_r($_FILES["file" . (string)$file]);
56 $file_arr[$file - 1] = 0;
57 if($_FILES["file" . (string)$file]["size"] >= $FILE_MAX){
58 echo "file" . (string)$file ." Over filesize limit-Server<br/>";
61 else if($_FILES["file" . (string)$file]["error"] == 1){
62 echo "file" . (string)$file ." PHP err " . $_FILES["file" . (string)$file]["error"] . "<br/>";
65 else if($_FILES["file" . (string)$file]["error"] == 2){
66 echo "file" . (string)$file ." Over filesize limit-Client<br/>";
69 else if($_FILES["file" . (string)$file]["error"] == 3){
70 echo "file" . (string)$file ." The uploaded file was only partially uploaded. <br/>";
73 else if($_FILES["file" . (string)$file]["error"] == 4){
74 echo "file" . (string)$file ." Empty<br/>";
75 if(!$die_state)$die_state = false;
78 echo "file" . (string)$file . " Unkown Upload Error <br/>";
90 echo "Upload Error\n";
95 $sql_ini = fopen("settings/sql.ini", "r");
97 while(!feof($sql_ini)){
98 $line = fgets($sql_ini);
99 $key = substr($line,0,strpos($line, ":"));
101 $value = trim(substr($line, strpos($line, ":")+
1));
102 $sql_data[$key] = $value;
105 $connection = new mysqli($sql_data["connection"], $sql_data["user"], $sql_data["pass"], $sql_data["database"]);
107 echo "Error: Unable to connect to MySQL." . PHP_EOL
;
108 echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL
;
109 echo "Debugging error: " . mysqli_connect_error() . PHP_EOL
;
114 $insert_query = "INSERT INTO TweetQueue(PostNo,Comment,ImageLocation) VALUES ('','"
115 . $_POST["comment"]. "','" . $file_string . "')";
116 echo $insert_query . "<br/>";
117 $result = $connection->query($insert_query);
119 echo "\n\n---------------\n\n";
121 $result = $connection->query("Select * from TweetQueue;");
125 for($row = $result->num_rows
- 1; $row >= 0 ; $row--){
126 $result->data_seek($row);
127 print_r($result->fetch_assoc());
130 echo "<hr/>Added to post queue<br/>";
133 <a href
="http://verniy.xyz/twitter/queue_form.html">Back to Form
</a
>