Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Informatie database
- $host = "localhost";
- $username = "linh7219_kennes";
- $password = "BagHera2";
- $db_name = "linh7219_shit";
- $tbl_name = "photos";
- $id = rand();
- session_start();
- //connect to database
- mysql_connect($host, $username, $password) or die("Can't connect");
- mysql_select_db($db_name) or die("Can't select database");
- $path1= "photos/".$HTTP_POST_FILES['ufile']['name'][0];
- $path2= "photos/".$HTTP_POST_FILES['ufile']['name'][1];
- $path3= "photos/".$HTTP_POST_FILES['ufile']['name'][2];
- mysql_query("INSERT INTO `".$tbl_name."` VALUES (".$id.", ".$c." );");
- copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
- copy($HTTP_POST_FILES['ufile']['tmp_name'][1], $path2);
- copy($HTTP_POST_FILES['ufile']['tmp_name'][2], $path3);
- echo "File Name :".$HTTP_POST_FILES['ufile']['name'][0]."<BR/>";
- echo "File Size :".$HTTP_POST_FILES['ufile']['size'][0]."<BR/>";
- echo "File Type :".$HTTP_POST_FILES['ufile']['type'][0]."<BR/>";
- echo "<img src=\"$path1\" width=\"150\" height=\"150\">";
- echo "<P>";
- echo "File Name :".$HTTP_POST_FILES['ufile']['name'][1]."<BR/>";
- echo "File Size :".$HTTP_POST_FILES['ufile']['size'][1]."<BR/>";
- echo "File Type :".$HTTP_POST_FILES['ufile']['type'][1]."<BR/>";
- echo "<img src=\"$path2\" width=\"150\" height=\"150\">";
- echo "<P>";
- echo "File Name :".$HTTP_POST_FILES['ufile']['name'][2]."<BR/>";
- echo "File Size :".$HTTP_POST_FILES['ufile']['size'][2]."<BR/>";
- echo "File Type :".$HTTP_POST_FILES['ufile']['type'][2]."<BR/>";
- echo "<img src=\"$path3\" width=\"150\" height=\"150\">";
- $filesize1=$HTTP_POST_FILES['ufile']['size'][0];
- $filesize2=$HTTP_POST_FILES['ufile']['size'][1];
- $filesize3=$HTTP_POST_FILES['ufile']['size'][2];
- if($filesize1 && $filesize2 && $filesize3 != 0)
- {
- echo "We have recieved your files";
- }
- else {
- echo "ERROR.....";
- }
- //////////////////////////////////////////////
- // What files that have a problem? (if found)
- if($filesize1==0) {
- echo "There're something error in your first file";
- echo "<BR />";
- }
- if($filesize2==0) {
- echo "There're something error in your second file";
- echo "<BR />";
- }
- if($filesize3==0) {
- echo "There're something error in your third file";
- echo "<BR />";
- }
- ?>
Add Comment
Please, Sign In to add comment