473,799 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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($ft p_server) or die("Couldn't connect to
$ftp_server");

if (@ftp_login($co nn_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 3720
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($ft p_server) or die("Couldn't connect to
$ftp_server");

if (@ftp_login($co nn_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*********@la poste.net> wrote in message
news:4f******** *************** **@posting.goog le.com...
<?php
$ftp_server = "192.168.25.25" ;
$ftp_user = "";
$ftp_pass = "";

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

if (@ftp_login($co nn_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:$des t`;
?>

to recieve files
<?
$fileSpec = "/somedir/myfile.txt"; // or $fileSpec =
"/somedir/tx_files/*";
$dest = "/somedir/";
`scp tr*********@192 .168.25.25:$fil eSpec $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
2164
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 pass the "Y" to system by php?
0
2354
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 Methods Version: $Revision: 1.34 $ Last-Modified: $Date: 2004/09/03 09:32:50 $ Author: Kevin D. Smith, Jim Jewett, Skip Montanaro, Anthony Baxter
6
2846
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 uneasy leaving it hanging in memory indefinitely (especially in case when string is Interned). So at leats for the case when string is not interned i propose:
2
55640
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", null); User user = new User (userid); XmlNode rolesNode = user.GetRoles (); rootNode.AppendChild (rolesNode);
6
2162
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 code, and how do I retrieve the list of all controls and child controls on that form (since I don't think I can just refer to Controls). #region AnyFieldErrors private bool AnyFieldErrors() {
1
2118
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 to run it, I get this error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection..." Here is my code (they are all generated by the wizard): Public Class WebForm1 Inherits System.Web.UI.Page
8
1844
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
5284
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 type(myDictionary) I get that the type is "instance", which makes no sense to me. What does that mean? Thanks
3
4534
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 Professional. The PHP version is 5.1.4. The PHP script is shown below. #! /usr/bin/php <?php $ftp_server = "myftpserver";
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10485
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.