ok so im getting an error i dont understand Warning: opendir(http://localhost/tom/galleries): failed to open dir: not implemented in c:\program files\easyphp1-7\www\tom\index2.php on line 4 now i cant give you all the code because it isnt mine to give. but heres the relevant stuff PHP: <?php function scan($base, $add) { $directory = "$base/$add"; $dh = opendir($directory) or die("There was problem opening $directory (scan)"); // MORE WORK DONE HERE } $base = "http://localhost/tom"; $start = "galleries"; scan($base, $start); ?> now iv been banging my head against the keyboard with no luck. what am i doing wrong
I think, you need to use the local address. So for windows you'd need to do c:\rootdir\folder\ rather then passing http://....
I don't suppose that's some sort of php addon, or something you can set in the php.ini file? It's possible the function is disabled and/or doesn't even exist. Or so I'd think from "not implemented". Maybe run a phpinfo() and see if opendir is anywhere on the page. That, or try losing the http:// - I think you may just want localhost/tom/galleries (or even just /tom/galleries) as your address. Windows-based servers especially can be really wierd that way. Not as confusing as when your code doesn't work on any system but the one it was coded on, but not all of us can be stupid enough to have short_tags enabled on their dev machine, and then actually *use* them in the code.
As simon is saying, you can only opendir a URL that has directory listing enabled.... is this configured correctly for the localhost web server?
it has been mapped acordingly. strangely enough i tried the code again today without making any changes and it ran. well farther then it was getting, still outputting errors for other areas but for the time being its opening the directory. now its just caught in an infinate recursion and crashing my test server. oh where will it end. thanks guys. i don know what the problem was, or why it started working all of a sudden, but im glad it is. thanks again guys
simon-w $base will be the address of a remote server if need be, it is also set in another secion of the code so if the script is running locally it sets $base to the local server address and script path Hwulex the script is coded for php4 backward compat.