Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

http//wwwhtmlgoodiescom/beyond/webmaster/articlephp/3548746/php-tips--tricks---a-picture-upload-part-1htm

PHP script Picture Image Upload
Wednesday, 25 January 2012 11:27
// Picture upload PHP script http://www.htmlgoodies.com/beyond/webmaster/article.php/3548746/PHP-Tips--Tricks---A-Picture-Upload-Part-1.htm


//print_r($_POST);

if($_POST["action"] == "Upload Image")
{
unset($imagename);

if(!isset($_FILES) && isset($HTTP_POST_FILES))
$_FILES = $HTTP_POST_FILES;

if(!isset($_FILES['image_file']))
$error["image_file"] = "An image was not found.";


$imagename = basename($_FILES['image_file']['name']);
//echo $imagename;

if(empty($imagename))
$error["imagename"] = "The name of the image was not found.";

if(empty($error))
{
$newimage = "images/" . $imagename;
//echo $newimage;
$result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimage);
if(empty($result))
$error["result"] = "There was an error moving the uploaded file.";
}

}

?>


">





if(is_array($error))
{
while(list($key, $val) = each($error))
{
echo $val;
echo "
\n";
}
}
?>



Credits::: Websites Lists and Web4Link.Com

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/N3TZWOxOpHM/14463

 


Taxonomy by Zaragoza Online