JS cannot be executed in the javascript-php file.

Source: Internet
Author: User
Tags php form
I want to return the upload file path to the front-end save, but the background php file JS is not executed, the foreground input tag value is always empty
The background acceptfile.php code is as follows:

 
  

Front-end index.php form forms:

Ask the question where the file is saved to the appropriate folder, the path cannot be returned to the front-end form form

Reply content:

I want to return the upload file path to the front-end save, but the background php file JS is not executed, the foreground input tag value is always empty
The background acceptfile.php code is as follows:

 
  

Front-end index.php form forms:

Ask the question where the file is saved to the appropriate folder, the path cannot be returned to the front-end form form

Parent
This variable refers to the parent window that contains the current split window. If there is a split window within a window, and a split window is included in one of the split Windows, the 2nd split window can refer to the parent partition window that contains it.

When you click Submit, the page is redirected and the parent is invalid.

It is recommended that you use Async.

The form has been submitted, the page refreshed, so the php file output JS useless, it is recommended to do Ajax upload, return the file storage path, and then submit the form.

  • Related Article

    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.