Help the younger brother to see this image upload function how to realize

Source: Internet
Author: User
Help the younger brother to see this image upload function how to realize
The code is as follows:
One. z.php Code













Re:














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
  
   
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.