Stefano Mtangoo
Senior Poster
3,731 posts since Jun 2007
Reputation Points: 462
Solved Threads: 396
Skill Endorsements: 0
so i got this but its not working
<?php
if ($HTTP_POST_FILES['type']!="jpg"){ echo "jpg only allowed";}
else {
$file_name = $HTTP_POST_FILES['ufile']['name'];
$random_digit=rand(00000,99999);
$desh = ".";
$new_file_name=$random_digit.$desh.$file_name;
$path= "upload/".$new_file_name;
if($ufile !=none)
{
if(move_uploaded_file($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "Successful<BR/>";
echo "File Name :".$new_file_name."<BR/>";
echo "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
echo "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
echo "<img src=\"$path\" width=\"150\" height=\"150\">";
}
else
{
echo "Error";
}
}
}
?>
Didn't I give a link with everything you have asked?
Stefano Mtangoo
Senior Poster
3,731 posts since Jun 2007
Reputation Points: 462
Solved Threads: 396
Skill Endorsements: 0