WordPress File handle – fopen, fwrite not working with $.ajax or $.post Jquery

I guess the issue with this line:

$path = "wp-content/themes/creation/templates/inc/log.txt";

You need to use the full path, not a relative part, while using fopen() or file_exists().

Something like this should fix your issue:

$path = get_template_directory() . "/templates/inc/log.txt";

get_template_directory() will return the absolute server path, without a trailing slash.

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