PHP inferred path referencing the php document itself
Basically, this error message says it all:
This error is thrown for this piece of code:
The file I want to access is users.txt. PHP appears to be searching through itself for this file. I've tried lots of stuff, including using the absolute path, to no avail. It always searches for whatever I put in those brackets within itself.
file_get_contents
takes a string
argument for the filename.
Try changing file_get_contents(./users.txt)
to
file_get_contents('./users.txt')
.
EDIT:
After discussion in the comments, also make sure to check that your file wasn't named incorrectly. ie, users.txt.txt
.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.