LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-25-2010, 04:46 AM   #1
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Rep: Reputation: 33
php in html


Hi folks nice easy one for once!

Code:
<?php
require_once "PHPFTP.php";

$ftp = new PHPFTP();

// if the first argument to Connect is blank,
// PHPFTP will connect to the local host via 127.0.0.1
$result = $ftp->Connect('tux.isa-geek.org','ftp','johnh@my.net');


if ($result == 0) {
$ftp->DoCommand('cd private', $result_number, $result_text);
$ftp->DoCommand('cd webcam', $result_number, $result_text);
$ftp->DoCommand('get lastsnap.jpg', $result_number, $result_text);

// say Disconnect(0); to break the connection without explicitly logging out
$ftp->Disconnect();
}
?>
two things i need one, is how do i ask this to use port 21. where it lives, default port is 91.

second, the file may exist, will it automaticly go over it? if not how do i ask php to del it first?. still learning php!
 
Old 01-25-2010, 04:53 AM   #2
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 547

Rep: Reputation: 115Reputation: 115
I'd imagine the answer to both questions will lie in PHPFTP.php.
 
Old 01-25-2010, 05:53 AM   #3
johnh10000
Member
 
Registered: Nov 2008
Distribution: Ubuntu Lucid Lynx
Posts: 541

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by devnull10 View Post
I'd imagine the answer to both questions will lie in PHPFTP.php.
thanks for your answer. but it turned out even easier than that!

ftp://tux.isa-geek.org/private/webcam/lastsnap.jpg

works a treat!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP without HTML mannclay Programming 6 11-09-2008 01:24 PM
html vs. php kotty Programming 13 11-28-2007 04:20 AM
Apache rending php when filename is x.php.html mastahnke Linux - Server 6 01-22-2007 08:39 AM
html into php charnel Programming 7 08-30-2005 10:47 AM
html to php? help me please!!!!! trscookie Programming 4 01-24-2005 06:36 AM


All times are GMT -5. The time now is 04:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration