is it possible to fire the execution of a script in the background via click?
I am within a CMS/CRM and want to trigger an external file to load when clicking on a certain link within the CMS/CRM.
e.g. activate the php.mailer to send an email.
It seems to be a security issue when using (cross domain vulnerability?)
foobar.onload()
and if it weren't, it would not execute the file in the background. I have seen that it was solved in python using with
subprocessor()
.
The external script would be on my domain though and not touch the CMS / CRM.
Any ideas?
In JavaScript you can't access to the filesystem, but you can use ajax to request some url with differents methods (GET, POST...).
The script you called from the url can execute a function to send an email if you want.
If you know jQuery, you can do something like that in JavaScript
And in your myScript.php file :
And if your php script is not on the same domain, you should check Access-Control-Allow-Origin header that allow your client (the browser which execute the ajax script) to call the remote php script