Learning notes: PHP image upload code _ PHP Tutorial

Source: Internet
Author: User
Tags ftp client
Learning notes: PHP image upload code details. Do you want to know how to write the uploaded image code? let's take a detailed analysis. With PHP, you can always complete a specific task in multiple ways. If you want to know how to write the uploaded image code, let's take a detailed analysis. With PHP, you can always complete a specific task in multiple ways. Let's take File upload as an example. Of course, you can use the traditional method to upload HTTP files and directly transfer the files to the Web server disk.

You can also upload files in a more exotic way, using the FTP protocol in two steps: from your local hard disk to the Web server, and then to the FTP server. PHP supports both FTP and HTTP uploads on the local machine, so you can make the best choice according to your application design needs. Using the FTP function of PHP for file transfer is almost the same as using the traditional FTP client-you will see that the name of the function is similar to the standard FTP command. I would like to share with you a small example of PHP uploading image code. I hope you can give me more comments. thank you for learning it together !!

PHP Upload image code:

 
 
  1. Phpsession_start();?>
  2. Php
  3. $Id=Mysql_connect('Localhost', 'root', '123 ');
  4. Mysql_select_db ("okhwyy", $ id );
  5. Mysql_query ("setnamesgb2312 ");
  6. ?>
  7. <Html>
  8. <Head>
  9. <Metahttp-equivMetahttp-equiv= "Content-Type"C>
  10. <Title>Restrict the format of uploaded images Title>
  11. <StyletypeStyletype="Text/css">

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.