Hi! I've been trying to right this script to index pdf files from a directory into a MySQL database for a dynamic site I'm making. I've gotten everything working with MySQL, and reading from the directory, but when I try to make readdir() take input from the command line, I get "supplied argument is not valid" and "Invalid Argument" for dir().
Here's the related code.
echo "Enter the Directory: ";
$stdin = fopen('php://stdin', 'r');
$input = fgets($stdin);
$handle = opendir($input);
while (false !== ($file = readdir($handle))) {
//and so on
Thanks!
Joe