I'm trying to pass a variable ( n ) from a JS script to PHP thru the URL and get it to write said variable to a file. Unfortunately I can see the PHP script being called over the network, with the appropriate URL and with 200 status, but it doesn't seem to be executing. The file it should be writing to never changes. The disk is not full, the file is not in use by another process and the file it is writing to has completely open permissions as a testing measure. Hopefully this is a simple fix, thanks in advance.
<?php $my_file='count.txt'; $count= $_GET['n']; $handle = fopen($my_file, 'w'); fwrite($handle, $count); fclose($handle); ?>
Examples of requests being sent