From:             jordan57702 at hotmail dot com
Operating system: Unix
PHP version:      4.2.3
PHP Bug Type:     FTP related
Bug description:  Warning: ftp_put(): error opening in 
/home/jd-mason/public_html/PHP_scripts/s4.

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 !
-- 
Edit bug report at http://bugs.php.net/?id=22619&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22619&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22619&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22619&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22619&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22619&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22619&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22619&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22619&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22619&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22619&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22619&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22619&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22619&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22619&r=gnused

Reply via email to