-1

Good evening,

I have this piece of PHP code :

<?php    
function testCopyFile($currentFile, $destinationFile)
{
    copy($currentFile, $destinationFile);
}    
?> 

Is there a means in my javascript code to call the function and to pass the two parameters?

Many thanks for your help.

Laurent
  • 711
  • 2
  • 12
  • 30

1 Answers1

0

No (hint "server side" vs "client side"). All you can do is to make HTTP request to the PHP code (be it GET or POST), and pass arguments in the request. The script you would invoke then be able to call that method.

PS: You are about to invent AJAX :)

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141