why does it say wrongfiletype? [omit/delete this question]
Posted: Tue Aug 21, 2007 12:21 pm
I don't understand why I get an error message for the file type, here's the code:
ERROR MESSAGE:
Code: Select all
<?php
$cnxdb = mysql_connect("localhost", "dtours3_deb", "cybergirl") or die("Could not connect: " . mysql_error());
mysql_select_db("dtours3_rich");
if(isset( $Submit ))
{
//If the Submitbutton was pressed do:
if ( ($_FILES['tourimage01']['tourimage02']['tourimage03']['tourimage04']['tourimage05']['tourimage01thumb']['tourimage02thumb']['tourimage03thumb']['tourimage04thumb']['tourimage05thumb']['type'] == "image/gif") || ($_FILES['tourimage01']['tourimage02']['tourimage03']['tourimage04']['tourimage05']['tourimage01thumb']['tourimage02thumb']['tourimage03thumb']['tourimage04thumb']['tourimage05thumb']['type'] == "image/jpg") ){
copy ($_FILES['tourimage01']['tourimage02']['tourimage03']['tourimage04']['tourimage05']['tourimage01thumb']['tourimage02thumb']['tourimage03thumb']['tourimage04thumb']['tourimage05thumb']['tmp_name'], "tours/tourimages/".$_FILES['tourimage01']['tourimage02']['tourimage03']['tourimage04']['tourimage05']['tourimage01thumb']['tourimage02thumb']['tourimage03thumb']['tourimage04thumb']['tourimage05thumb']['name']) or die ("Could not copy.....");
$strDescription = addslashes(nl2br($txtDescription));
$straddress = addslashes(nl2br($txtaddress));
$imagefile = $_FILES['tourimage01']['tourimage02']['tourimage03']['tourimage04']['tourimage05']['tourimage01thumb']['tourimage02thumb']['tourimage03thumb']['tourimage04thumb']['tourimage05thumb']['name'];
$query = "INSERT INTO tours (tourid, title, company, address, desc, feature_num, tourimage01, tourimage02, tourimage03, tourimage04, tourimage05, tourimage01thumb, tourimage02thumb, tourimage03thumb, tourimage04thumb, tourimage05thumb, logo ) VALUES ('', '$title', '$company', '$straddress', '$strDescription', '$feature_num', '$tourimage01','$tourimage02','$tourimage03', '$tourimage04', '$tourimage05', '$tourimage01thumb', '$tourimage02thumb', '$tourimage03thumb', '$tourimage04thumb', '$tourimage05thumb', logo)";
mysql_query($query, $cnxdb);
echo "";
echo "Name: ".$name."";
echo "Size: ".$_FILES['tourimage01']['size']."";
echo "Type: ".$_FILES['tourimage01']['type']."";
echo "Size: ".$_FILES['tourimage02']['size']."";
echo "Type: ".$_FILES['tourimage02']['type']."";
echo "Size: ".$_FILES['tourimage03']['size']."";
echo "Type: ".$_FILES['tourimage03']['type']."";
echo "Size: ".$_FILES['tourimage04']['size']."";
echo "Type: ".$_FILES['tourimage04']['type']."";
echo "Size: ".$_FILES['tourimage05']['size']."";
echo "Type: ".$_FILES['tourimage05']['type']."";
echo "Size: ".$_FILES['tourimage01thumb']['size']."";
echo "Type: ".$_FILES['tourimage01thumb']['type']."";
echo "Size: ".$_FILES['tourimage02thumb']['size']."";
echo "Type: ".$_FILES['tourimage02thumb']['type']."";
echo "Size: ".$_FILES['tourimage03thumb']['size']."";
echo "Type: ".$_FILES['tourimage03thumb']['type']."";
echo "Size: ".$_FILES['tourimage04thumb']['size']."";
echo "Type: ".$_FILES['tourimage04thumb']['type']."";
echo "Size: ".$_FILES['tourimage05thumb']['size']."";
echo "Type: ".$_FILES['tourimage05thumb']['type']."";
echo "Size: ".$_FILES['logo']['size']."";
echo "Type: ".$_FILES['logo']['type']."";
echo "Copy Done....";
}
else {
echo "";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage01']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage02']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage03']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage04']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage05']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage01thumb']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage02thumb']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage03thumb']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage04thumb']['name'].")";
echo "Could Not Copy, Wrong Filetype (".$_FILES['tourimage05thumb']['name'].")";
}
}
?>Could Not Copy, Wrong Filetype (lobby.jpg)Could Not Copy, Wrong Filetype (office.jpg)Could Not Copy, Wrong Filetype (conference.jpg)Could Not Copy, Wrong Filetype (reception.jpg)Could Not Copy, Wrong Filetype ()Could Not Copy, Wrong Filetype (lobby-150.jpg)Could Not Copy, Wrong Filetype (office-150.jpg)Could Not Copy, Wrong Filetype (conference-150.jpg)Could Not Copy, Wrong Filetype (reception-150.jpg)Could Not Copy, Wrong Filetype ()