Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 19th, 2003, 03:59 PM
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
  #2 (permalink)  
Old June 20th, 2003, 11:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
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
Reply With Quote
  #3 (permalink)  
Old June 23rd, 2003, 03:20 PM
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

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

----------------------------
Oh happyland!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:37 AM.


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