| |||||||||||
| |||||||||||
Sample script - FTP to get a file from within PHP
A worked example from today's course - Only the password has been changed
<?php $conn_id = ftp_connect("www.savethetrain.org.uk"); $login_result = ftp_login($conn_id, "savethetrain", "melksham"); if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; exit; } else { echo "Connected"; } // get the file $local = fopen("local.txt","w"); $result = ftp_fget($conn_id, $local,"httpdocs/trlog.txt", FTP_BINARY); // check upload status if (!$result) { echo "FTP download has failed!"; } else { echo "Downloaded "; } // close the FTP stream ftp_close($conn_id); ?> (written 2007-03-01 14:41:10) Associated topics are indexed under H109 - PHP - Input / Output
Some other Articles
Wondering where I have beenPassenger flows Three big events - TWSW, Business of the year and the police Train and business balls all in the air! Sample script - FTP to get a file from within PHP Apache httpd , browser, MySQL and MySQL client downloads PHP fread - truncated data Wiltshire Train - can YOU come on 5th March? Tcl training - often for a larger group The Psyche is all wrong. 1690 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||