Hey DP! I've been a long-time lurker, so you might not know me But I have finally encountered a problem in my script. The rest of the program works fine, except for this one part. My program scans for IPs on your LAN, and returns the IPs found with webservers. This all works great. However, I want to add a directory listing feature, where you can view a directory listing of that IP. I know that glob("*"); would work perfectly for this, but that code would only return the current files in the directory the code is running from. How can I do something similar to glob("*") on an IP that is still on my network (192.168.0.207 is my machine, I want to get the listing for 192.168.0.1, my test server)? I've looked at fsockopen() quiet a bit, but it seems like a completely different language to me. Rarely have I used functions like fgets(), where you need to specify the amount of bytes to grab (or something?)! Thank you! -Jaxo
Sorry for the late reply! Yes, I am running Linux. However, I tried what you said and it just ended up downloading the target into a directory. Of course, then I could just loop through the directory, but I'd rather not make the server download every single file. Also, it won't download .php files, with their PHP variables and code inside. I should be able to do this though, because the files are still on my local network, right?
It's an HTTP directory, the very same thing you'd get if you entered a directory in a web browser without an index.*
Well, I mean, you can't just list the directory contents of a remote server. Think of all of the security related problems that would occur if you could. Your best bet is to set up some form of PHP or bash script on the remote server that you can communicate with.
Ah, that's true. I've had this problem in the past, too, and I ended up doing something like that. This time I assumed, since it's local, it would be different. But I guess if the script isn't executing from that IP, you can't execute code as if it was. Thanks for all your help, guys!