0

I have a MyAccount page for my website which is going to have a form to allow the users to upload an image.

<from action='javascript:uploadFile'>
     <input type='file' name='Upload'>
</form>

What I would like to do is have it call another .php file like:

<script type="text/javascript">
    function uploadFile()
    {
         addPhoto.php giving files $id and Upload (from the form)
    }

How can I achieve this without the user actually leaving the MyAccount page?

3

1 Answer 1

0

You can use include or require within a PHP file.

The include statement includes and evaluates the specified file.

You would need AJAX/jQuery to call it through JavaScript.

Documentation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.