Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-18-2013, 07:37 AM
hdn
Unregistered

Posts: n/a

Important phuploader, move file

hi All ,
i have a question.
i use phuploader,
can i upload file and move to another ftp server ?
i search abut this, and i fund it :

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple FTP Upload Script using PHP by 2netlodge</title>
</head>

<body>
<?php
if(isset($_POST['ftp']))
     {
        
$ftp $_POST['ftp'];
        
$username $_POST['username'];
        
$pwd $_POST['pwd'];
        
$filename $_FILES['file']['name'];
        
$tmp $_FILES['file']['tmp_name'];
        
$d $_POST['des'];
       
        
$connect ftp_connect($ftp)or die("Unable to connect to host");
        
ftp_login($connect,$username,$pwd)or die("Authorization Failed");
        echo 
"Connected!<br/>";               
       
        if(!
$filename)
            {
                echo
"Please select a file";
            }
        else
            {
                
ftp_put($connect,$d.'/'.$filename,$tmp,FTP_ASCII)or die("Unable to upload");
                        echo
"File successfully uploaded to FTP";
            }
    }
       
               
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="text" name="ftp" placeholder="FTP link"/><br/>
<input type="text" name="username" placeholder="Username"/><br/>
<input type="password" name="pwd" placeholder="Password"/><br/>
<input type="file" name="file" /><br/>
<input type="text" name="des" placeholder="Destination"  /><br/>
<br/><input type="submit" value="Upload"/></form>

</body>
</html>

how to i can move the file after upload to another server with ftp accunt?
tank you
Reply With Quote
  #2  
Old 09-19-2013, 08:06 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,921

Take a look at this:

http://stackoverflow.com/questions/9...ains-character
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:58 PM.




Powered by vBulletin®