I am trying to upload an image along with other information
The only process I am having problems with it the upload.
This is what I am using to test the upload.
class image_upload
{
var $upload_file_name = "";
var $upload_dir = "./Uploads/";
function upload()
{
print_r($_FILES);
$uploaded_file = $this->upload_dir . $_FILES['userfile']['name'];
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaded_file))
{
echo "File is valid, and was successfully uploaded.\n";
}
else
{
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
}
}
?>
THe form calls a script that calls the queries to add evertthing to the database and to add the file. That info is here
//Lets enter Business Info into db
$sql = new ad_queries;
$sql->add_business($pword, $date);
//Lets upload the image
$uload = new image_upload;
$uload->upload();
//$redirect = "http://www.greenwingassociates.com/projects/busstore/Admin/index.php?page=main";
//header(sprintf("Location: %s", $redirect));
}
?>
When I test it $_FILES array is not being passed to the upload script page.