So right now I am trying to upload a .txt file and send it to mysql. That part works fine. But I have my code looking for a set file name, like text.txt. The txt file is being ftp'd into a directory, then a button in a php file is pressed and it looks for that file, reads it and sends it to the db. However, the file is going to be ftp'd with different names everday, like date. It will be uploaded like this: test20130802.txt
How do I get my code to look for that date variable? It won't always be today's date either.
Here is part of my current code:
$handle = @fopen("test.txt", "r");
$values='';
while (!feof($handle))
{
$buffer = fgets($handle, 4096);
//MYSQL QUERY......
}
Any help is greatly appreciated. Thank you.