473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

FTP_login + $pass="" and $user=""

Hi,

I use the following scrit in an Intranet with the user name = "" and
the password = "" :

<?php
$ftp_server = "192.168.25.25";
$ftp_user = "";
$ftp_pass = "";

$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to
$ftp_server");

if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
echo "Connected at $ftp_user@$ftp_server\n";
} else {
echo "Can't connect with $ftp_user\n";
}
?>

I have the following message :

Connected to 192.168.25.25
Warning: ftp_login(): 'USER': Invalid number of parameters in
E:\www\test_ftp.php on line 26

I tried to : ftp_login($conn_id, "", "") but i have the same result...

Does anybody have an idea ?

Thank in advance...
Jul 17 '05 #1
2 3694
jissay wrote:
Hi,

I use the following scrit in an Intranet with the user name = "" and
the password = "" :

<?php
$ftp_server = "192.168.25.25";
$ftp_user = "";
$ftp_pass = "";

$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to
$ftp_server");

if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
echo "Connected at $ftp_user@$ftp_server\n";
} else {
echo "Can't connect with $ftp_user\n";
}


I have the following message :

Connected to 192.168.25.25
Warning: ftp_login(): 'USER': Invalid number of parameters in
E:\www\test_ftp.php on line 26

I tried to : ftp_login($conn_id, "", "") but i have the same result...

Does anybody have an idea ?

Thank in advance...


You can't have a blank username. Are you trying to use Anonymous FTP? If so,
set the username to Anonymous, and the password to an email address...
Jul 17 '05 #2
"jissay" <jc*********@laposte.net> wrote in message
news:4f*************************@posting.google.co m...
<?php
$ftp_server = "192.168.25.25";
$ftp_user = "";
$ftp_pass = "";

$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to
$ftp_server");

if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
echo "Connected at $ftp_user@$ftp_server\n";
} else {
echo "Can't connect with $ftp_user\n";
}
?>


Intranet? I assume this is all local? even the ftp server (i did see the
local ip)

in that case why bother with ftp if you controll the intranet? just set up a
trusted user key for your script and do this:

to send files
<?
$fileSpec = "/somedir/myfile.txt"; // or $fileSpec =
"/somedir/tx_files/*";
$dest = "/somedir/";
`scp $fileSpec tr*********@192.168.25.25:$dest`;
?>

to recieve files
<?
$fileSpec = "/somedir/myfile.txt"; // or $fileSpec =
"/somedir/tx_files/*";
$dest = "/somedir/";
`scp tr*********@192.168.25.25:$fileSpec $dest`;
?>

or even simpler, just map one of the ftp servers directories into your
webserves directories,
so it wouyld be like this

on webserver
/www/somesite/filearea

would actualy be a directory on the ftp server
/ftpfiles/shared/filearea

--
Mike Bradley
http://gzen.myhq.info -- free online php tools


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jiing.deng | last post by:
I want to use the system command to set user's priority $cmd = "cacls d:\\appserv\\www\\accountMng\\$userName /G $userName:F"; system($cmd); Then it appears Are you sure (Y/N)? How can I...
0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
6
by: cppdev | last post by:
Hi All! I want to clear the string contents from sensitive information such as passwords, and etc. It's always a case that password will appear as string at some point or another. And i feel...
2
by: Eirik M. | last post by:
Hi, I've got the following piece of code that's causing me a bit of a problem XmlDocument doc = new XmlDocument (); XmlNode rootNode = doc.CreateNode (XmlNodeType.Element, "usersettings",...
6
by: Vern | last post by:
I'd like to make the following a generic method that all my forms can call to validate all the fields on the form. So how do I pass the form object that is represented as "this" in the following...
1
by: fl | last post by:
I am running ASPNET on my local machine. I have a problem when I try to connect to a SQL server database table. The data looks good when I right click SqlDataAdapter1 to preview the data. When F5...
8
by: Maxi | last post by:
Hello, i'm sorry my bad english :( I have CR9 Webservice, how to change databadse name and User_name into Webservice method? (not Viewer Control) Tks!! -- --------------------------
15
by: Cruella DeVille | last post by:
I'm trying to implement a bookmark-url program, which accepts user input and puts the strings in a dictionary. Somehow I'm not able to iterate myDictionary of type Dict{} When I write print...
3
by: blackpuppy | last post by:
I am just beginner on PHP. I am reading "Spring Into PHP 5" but cannot make the ftp examples work. I am running PHP scripts on a Fedora Core 5 (VMWare virtual machine) on top of a Windows XP...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.