Can I pass image form data to a PHP function for upload?

后端 未结 3 1107
北荒
北荒 2021-01-07 03:59

I\'m trying to use jquery and PHP to upload an image like so:

HTML

<
3条回答
  •  失恋的感觉
    2021-01-07 04:43

    You can use $.ajax method in jquery and send the form data to a php file.

     $.ajax({
      type: "POST",
      url: "http://localhost/index.php",
      data: data,
      success: success,
    });
    

提交回复
热议问题