php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22619 Warning: ftp_put(): error opening in /home/jd-mason/public_html/PHP_scripts/s4.
Submitted: 2003-03-10 02:55 UTC Modified: 2003-03-10 10:32 UTC
From: jordan57702 at hotmail dot com Assigned:
Status: Not a bug Package: FTP related
PHP Version: 4.2.3 OS: Unix
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jordan57702 at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-03-10 02:55 UTC] jordan57702 at hotmail dot com
This is odd to me, I am making a small FTP upload client for my webpage. What is odd about this, is the one that POSTS to itself doesn't work, however the other one I have, which has EXACTLY the same php code and is two separate pages works. I CAN'T FIGURE THIS OUT, HELP ! !

---------- s4.php (POST TO ITSELF) ----------

<?
function upload(){
$server = "jd-mason.com";
$con = ftp_connect($server);
$user = "jd-mason";
$pass = "grammer";
ftp_login ($con, $user, $pass);
ftp_cdup($con);
ftp_pwd($con);
ftp_chdir($con, 'home/public_html/PHP_scripts/');
ftp_pwd($con);
$upload = ftp_put($con, $destination_file, $source_file,  FTP_BINARY);
ftp_close($con);
};
?>
<html>
<body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4 bgcolor=white vlink="#0000ff" link="#0000ff">
FILE UPLOAD
<P>
<form method=POST action="s4.php" enctype="multipart/form-data">
Source File:<input type=file name=source_file size=20><BR>
Destination File:<input type=text name=destination_file size=20><BR>
<input type=submit name=Submit value=Submit size=20 style="border: 1px solid #0000FF"></form>
<?
if(isset($HTTP_POST_VARS[Submit])){
upload();
};
?>
</body>
</html>

---------- h.html (POST TO s4_backup.php) ----------
<html>
<body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4 bgcolor=white vlink="#0000ff" link="#0000ff">
FILE UPLOAD
<P>
<form method=POST action="s4.php" enctype="multipart/form-data">
Source File:<input type=file name=source_file size=20><BR>
Destination File:<input type=text name=destination_file size=20><BR>
<input type=submit name=Submit value=Submit size=20 style="border: 1px solid #0000FF"></form>
</body>
</html>

---------- s4_backup.php ----------

<?
function upload(){
$server = "jd-mason.com";
$con = ftp_connect($server);
$user = "jd-mason";
$pass = "grammer";
ftp_login ($con, $user, $pass);
ftp_cdup($con);
ftp_pwd($con);
ftp_chdir($con, 'home/public_html/PHP_scripts/');
ftp_pwd($con);
$upload = ftp_put($con, $destination_file, $source_file,  FTP_BINARY);
ftp_close($con);
};
?>


THESE LAST TWO WORK ! !  WTF IS GOING ON !

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-10 10:32 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC