FTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

I took this code directly from PHP.net but I don't get it to work correctly...I've never worked with ftp-connections with PHP before...


<?php

$ftp_server = "ftp.example.com";
$ftp_user = "foo";
$ftp_pass = "bar";

// set up a connection or die
$conn_id = ftp_connect($ftp_server) 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";
} else {
  echo "Couldn't connect as $ftp_user\n";
}

// close the connection
ftp_close($conn_id);
?>

It seems to work fine when I'm trying on my testmachiner (WIndows XP + Apache) , but when I put the file on the webserver at my webhost (b-one), then I just get a blank page and showing source-code like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

What could be the problem?

/G
http://www.varupiraten.se/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux