FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 22nd, 2004, 07:29 PM
epanagio's Avatar
epanagio epanagio is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 415 epanagio User rank is Corporal (100 - 500 Reputation Level)epanagio User rank is Corporal (100 - 500 Reputation Level)epanagio User rank is Corporal (100 - 500 Reputation Level)epanagio User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 9 h 33 m 41 sec
Reputation Power: 9
issuing command in ftp session

I have the following script:
PHP Code:
<?php
$ftp_server 
"server";
$command 'dir';
$ftp_user_name "zzz";
$ftp_user_pass "cccc";
$conn_id ftp_connect($ftp_server);

$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

if (
$res ftp_exec($conn_id$command)) {
   echo 
"$command executed successfully<br />\n";
   echo 
nl2br($res);
} else {
   echo 
'could not execute ' $command;
}

?>


It connects without a problem but I get the error:

Quote:
Warning: ftp_exec(): Unknown command. in /home/epanagio/php/ftp/exec_command.php on line 10
could not execute dir


If I try to ftp using a shell I can issue the "dir" command and get a listing of the directory.

Thanks
__________________
Evan

Reply With Quote
  #2  
Old March 22nd, 2004, 07:30 PM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,224 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 34 m 57 sec
Reputation Power: 174
dir is a windows command - just a sanity check, but your server is on windows, correct?
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever.
Analyze twice; hack once.
The world's first existential ITIL question: If a change is released into production without a ticket to track it,
was it actually released?


About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect -
Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire


Reply With Quote
  #3  
Old March 22nd, 2004, 07:34 PM
epanagio's Avatar
epanagio epanagio is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 415 epanagio User rank is Corporal (100 - 500 Reputation Level)epanagio User rank is Corporal (100 - 500 Reputation Level)epanagio User rank is Corporal (100 - 500 Reputation Level)epanagio User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 9 h 33 m 41 sec
Reputation Power: 9
Yes, It is a Windows 2000 server.

That's why I ftp using a command window to test the command.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > issuing command in ftp session


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway