Thread: File Access
View Single Post
  #1 (permalink)  
Old June 19th, 2003, 03:59 PM
natmaster natmaster is offline
Authorized User
 
Join Date: Jun 2003
Location: , , USA.
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to natmaster Send a message via AIM to natmaster Send a message via MSN to natmaster
Default File Access

I want to read some files for some dynamic pages from a folder on my server that is not set to be readable by the public; i can't just change the attributes because it is bought server space and so some folders i cannot change. I can access these folders if i login as my account so i was wondering if there were some way i could have the php script log me in so i can read from those files.

I tried:
$ftp_server = "???";
$ftp_user = "???";
$ftp_pass = "???";

// set up a connection or die
$conn_id = ftp_connect("$ftp_server",21) or die("Couldn't connect to $ftp_server");

// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
    echo "Connected as $ftp_user@$ftp_server\n";
    exit();
} else {
    echo "Couldn't connect as $ftp_user\n";
    exit();
}
//opens file for reading down here

i thought that might solve my problem, but i just got this error:
Fatal error: Call to undefined function: ftp_connect() in /usr/data/httpd/users/mordecai/immortal/finishLogin.php on line 18
(line 18 is the line i use ftp_connect())

----------------------------
Oh happyland!
__________________
----------------------------
Aeon of Darkness MUD - Free Online Roleplaying Game
http://aeonofdarkness.com
Reply With Quote