This is my 2nd topic Ive wrote about here. The 1st was welcomed with lots of great help which I am very appreciative of and I thank you all very much. Now I've got another issue that is stumping me:
I'm a newbie and Im watching a series of PHP tutorials and working through each example on my localhost with the thanks going to xampp but I'm having trouble now. although please note: All other tutorials are working properly while using xampp.
For example: In this tutorial: http://thenewboston.org/watch.php?cat=11&number=82
I have done everything exactly as illustrated (see MY code below)
- Code: Select all
<?php
//Tut 82 & 83 File Handling: Listing Files
echo '<strong>Tut 82 & 83 File Handling: Listing Files</strong><br><br>';
$directory = 'testing';
if ($handle = opendir($directory.'/')){
echo 'Looking Inside Directory \''.$directory.'\':<br>';
while ($file = readdir($handle)){
echo $file.'<br>';
}
}
?>
The problem is that I have a folder called testing inside my alias folder(where all the other tutorials have been working) but now I get the following errors:
Warning: opendir(testing/,testing/): The system cannot find the file specified. (code: 2) in obscuredforsecurity/testing\tut82-83.php on line 6
Warning: opendir(testing/): failed to open dir: No such file or directory in obscuredforsecurity\testing\tut82-83.php on line 6
What baffles me is why is it saying: Warning: opendir(testing/,testing/): ?? I never specified testing/,testing/. Why it doesn't just say: Warning: opendir(testing/): is beyond me as I only specified the folder testing ONCE.
The thing is that I've checked and double checked my file paths and the works but nothing seems to work
If anyone wouldn't mind setting me straight here, I'd be most appreciative and I thank you all once again.