在javascript中包含php文件[关闭]

I have a php file that does a database lookup and sends emails to users.

How do I include this in a javascript function?

Adding another sentence so I can submit this question.

if you want to make PHP execute from javascript, you can make an AJAX request to a server that executes the PHP.

You'll probably want to run this PHP script using AJAX. Have a look at jQuery which makes AJAX a lot easier.

PHP or other file are not different for javascript. you only can open php file by javascript as an URL. with these php file will executed. but with javascript you can't execute a method of your php file.