I am doing my first PHP script (Following a tutorial in a book) There are errors on certain lines to do with the Directory path, and help? These are the errors: $dir .= $dir1; $dh = opendir($dir); Code (markup): while ($file = readdir($dh)) : Code (markup): closedir($dh); Code (markup): I think I have to make a directory, if so what name? I need help!
That is the code that is causing the errors. What are the actual error message(s)? Are you talking about something like this?: if (!is_dir($dir)) mkdir($dir); PHP:
$dir is a variable that should contain a string. You need to find out what value is stored in $dir by echoing it, as was recommended in a prior comment. Simply do this within your code: echo $dir; Then you can create a folder with the same name as what is stored in this variable.