Load php function with AJAX on modal window

You can’t directly use sendTrailer.php ,wordpress can’t find this custom page directly so you have to specify fully path of that page using

get_template_directory()

In your ajax function write

url : '<?php echo get_template_directory(); ?>/sendTrailer.php'

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)