Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2003, 03:59 PM
Authorized User
 
Join Date: Jun 2003
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
 
Old June 20th, 2003, 11:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Moharo
Default

this might be due to the fact that your hosting company disabled ftp_connect() function :((((

the genuine genius
 
Old June 23rd, 2003, 03:20 PM
Authorized User
 
Join Date: Jun 2003
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

i got it to work now, just using an ftp login as part of the filename (ftp://username:password@domain/filelocation)

----------------------------
Oh happyland!





Similar Threads
Thread Thread Starter Forum Replies Last Post
File access issue? asif110 Assembly Language 2 September 11th, 2007 02:06 PM
Convert MS Excell file into MS Access file ashish2001mca General .NET 0 June 29th, 2006 07:09 AM
File Access ra7207 VB.NET 2002/2003 Basics 0 June 20th, 2006 01:42 PM
File Access mtullock BOOK: ASP.NET Website Programming Problem-Design-Solution 1 December 21st, 2005 06:02 AM
ADE file in Access 2000 <---> Access XP ginoitalo Access 3 April 14th, 2004 09:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.