Hello,

I created this PHP script (actually it came from my book). It 
apparently connects to the FTP site okay, but I cannot log on. The 
user name and password have been double-checked for typos, but for 
security reasons I cannot put them up here, so I just put "user_name" 
and "password" here.

Here is the snippet that is problematic:

<html> 
<head> 
  <title>LSR FTP Script</title> 
</head> 
<body> 
<h1>LSR FTP Script</h1>  
<?php 
// set up variables 
$host = 'host.com'; 
$user = 'user_name'; 
$password = 'password'; 
$remotefile = 'addendums.txt.gz'; 
$localfile = 'addendums.txt.gz'; 

// connect to host 
$conn = ftp_connect("$host");  
if (!$conn) 
{ 
  echo 'Error: Could not connect to ftp server<br />'; 
  exit; 
} 
echo "Connected to $host.<br />"; 

// log in to host 
$result = ftp_login($conn, $user, $pass); 
if (!$result) 
{ 
  echo "Error: Could not log on as $user<br />"; 
  ftp_quit($conn); 
  exit; 
} 
echo "Logged in as $user<br />"; 

Is there anything I can add to this script that will allow me to see 
exactly why the user name is not being accepted?

Also, if I use my browser or command line to connect to the FTP site, 
I CAN enter my user name and password, and can get into the FTP site 
fine. 

The messages I receive when I attempt to connect to the FTP site 
using my PHP script are as follows:

-----
Connected to host.com.
Error: Could not log on as user_name
-----



Thanks in advance!









Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to