security - PHP writing to a text file on server -
i have log process writes little custom .txt log file on server when people supply input on particular form (so can keep eye on trying use injection). my question: file plaintext, , not link anywhere in code other php calls file_get_contents , file_put_contents . there way see file? search engine possibly find it? (i understand security obscurity. question how 1 might possibly "unobscure" this.) i understand security obscurity. question how 1 might possibly "unobscure" this. they need able know site’s code structure & logic. if name directory logs stored in other logs/ first decent step. or keep directory named logs/ have nested in directory know such my_cool_stuff/logs . if want sure nobody get’s it, can set apache config rule block directly reading .txt files directly browser, use apache files directive in web site’s apache config or in .htaccess on site: <files ~ "\.(txt|yml|yaml)$"> order allow,deny deny