|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-04 14:01 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 12:00:01 2025 UTC |
Description: ------------ Iam writing a code for transfering(uploading) file from one server to another server from the client system. Iam using FTP functions for that.Iam also giving the code below Function uploadTemplate($hostname,$FTPUserName,$FTPPassword,$remotelocation){ $handle=@ftp_connect("$hostname"); $mixed=@ftp_login($handle,$FTPUserName,$FTPPassword) ; $workingDirectory=@ftp_pwd($handle); $workingDirectory=str_replace( "/home","",$workingDirectory); $workingDirectory=str_replace("ftp","",$workingDirectory); $local="$local"; //$remote=$remotelocation."index.php"; $remote="/www/htdocs"; $remote=$remote.$workingDirectory."sample.php"; directory=".$workingDirectory."<br>remote=$remote"); $upload_success=@ftp_put($handle,$remote,$local,FTP_BINARY) ; echo($upload_success); @ftp_quit($handle); return $upload_success; } ?> When i used IP address of the host instad of host name only ftp_put shows FALSE. Otherwise entare code is not working. Please replay me.