Help the younger brother to see this image upload function how to realize
The code is as follows:
One. z.php Code
Two. zz.php Code
echo $_files["TValue" ["Tmp_name"];
if (Move_uploaded_file ($_files["I_hffb_file1" ["Tmp_name"], "a.jpg"))
{
echo "Success";
}else{
echo "Failure";
}
?>
The above code click on the control i_hffb_file1 "Browse" button, select the picture and then click "Open" to upload your own pictures successfully,
Because there is onchange= "form_uploadpic1.submit ();" This event submits the form,
But I want to use a small picture charutupian_bendi.gif to replace the I_hffb_file1 control's browse button,
onclick= "document.getElementById (' I_hffb_file1 ')." Click ();
After clicking on the small image, you can open the I_hffb_file1 control's Select File window, but after selecting the image and clicking "Open",
But you can't upload pictures.
The Value property of the I_hffb_file1 control is also null.
What is this for,
Did you choose the picture file already?
May I ask how this problem should be solved?
------Solution--------------------
That's not going to work because it violates the security rules.
If you rename z.php to Z.htm,
Modify action= "zz.php" to action= "http://localjost/zz.php"
And put it on the local. Open with file:///z.htm.
So congratulations, on most browsers, you can upload the success
------Solution--------------------
PHP Code