Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-10-2009
Member
 
Join Date: Jun 2009
Posts: 92
Open a remote directory with PHP

I use a piece of code that allows you to list files within a directory. I do it internally and it works well. Now I would like to do a remote site? How do I proceed?

PHP Code:
<?php
$rep 
"folder/"//ere is the directory to open - why not directly http://my_site.com/open_a_folder --> this does not
$dir opendir($rep);
    while (
$fp readdir($dir))
    {
      if (
$fp !="." && $fp != ".." )
      {
      if(
is_dir($rep."".$fp))
      {
      echo (
"$fp<br />\n" );
    }
  }
closedir($dir);
?>
Reply With Quote
  #2  
Old 27-10-2009
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: Open a remote directory with PHP

It completely depends on how you connect the "remote site"? http, ssh, nfs, ftp, samba, (...)?
Reply With Quote
  #3  
Old 27-10-2009
Member
 
Join Date: Jun 2009
Posts: 92
Re: Open a remote directory with PHP

I was hoping to use directly the opendir () from PHP page hosted on any server (Free for not naming); can always dream ...

I think it is therefore an HTTP connection.
Reply With Quote
  #4  
Old 27-10-2009
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: Open a remote directory with PHP

Well in that case, unless I am mistaken, you can not use these functions. If the directory in question (eg "http://mysite/directory") contains an index file, you can always go back and analyze it (often a html file).
Reply With Quote
  #5  
Old 27-10-2009
Member
 
Join Date: Jun 2009
Posts: 92
Re: Open a remote directory with PHP

I succeeded in creating a file listing the site directory to analyze and integrate this listing page on my home page, a bit long and complicated to implement but effective.

The advantage is that I have a site with a list of data in a directory with information and sites all parents are automatically updated ... (eg list of countries, currencies, plants, etc ...)
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Open a remote directory with PHP"
Thread Thread Starter Forum Replies Last Post
How to remote set up SSH for Home Directory StephanieRice Networking & Security 2 01-07-2009 11:15 AM
Active Directory Remote Desktop Permissions hippey Active Directory 3 14-05-2009 08:00 PM
Open Windows Exporer in Any Directory Shikhar Customize Desktop 3 04-04-2009 12:18 PM
Access remote directory with a public IP address Daljeet Software Development 4 19-12-2008 06:09 PM
How to connect remote user in Active directory prash_mate Active Directory 1 08-04-2007 09:18 AM


All times are GMT +5.5. The time now is 12:52 AM.