corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP Day -> FTP Class


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author PHP Day -> FTP Class
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
6th Dec 07 at 19:56   View User's Profile U2U Member Reply With Quote

Can I have another set of eyes on this?

code:

function connect($address,$username,$password)
{

$this->ftpaddress=$address;
$this->ftpusername=$username;
$this->ftppassword=$password;

$this->connection=ftp_connect($this->ftpaddress);
if($this->connection!=FALSE)
{
echo("Connected!!");

ftp_pasv($this->connection, true);

$result=ftp_login($this->connection,$this->ftpusername,$this->password);

echo($result);
if($result==FALSE)
{
$this->message="Login Details Incorrect";
}
else
{
$this->message="Logged In!";
}

}

echo($this->message);
}




In my mind this should work, but I keep getting a mixture of errors, from the FTP address being incorrect to the username/password combo being wrong.

Interestingly, when I echo($this->variable); I get "$this->variable".

Thanks GeekDay

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
anyone use 1and1 webhostin??......nismo get in here! Icy Geek Day 22 792
28th Dec 04 at 16:22
by Icy
 
How do I go about making a CRON job to do these 2 commands??? PaulW Geek Day 10 901
12th Jan 06 at 19:05
by PaulW
 
PHP FTP help ASAP please :) Antz Geek Day 1 159
8th Jan 07 at 18:12
by andy.ros
 
''Problem loading page....'' Kathryn W Geek Day 8 590
15th Feb 07 at 08:30
by Andrew
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP Day -> FTP Class 29 database queries in 0.0114279 seconds