Salve, volevo sapere se c'è qualcuno che può dirmi come mai nel sito o meglio nel dominio di mio fratello essendo che lui usa windows host ..questo ftp non va:
invece nel mio host linux su un'altra hoster .. mi funziona senza modificare lo script.??
Il mio è sul servizio linux su tophost invece quello del mio fratello registrato da anni e su host windows register.
scusatemi se non si possono dire i nomi dei hoster.. ma ho un problema con questo script che nel mio funziona normalmente ma su quello di mio fratello no.
ed in oltre questo lo aggiancio al resize thumb.. solo che lo script si ferma alla login e pure l'ftp sono giuste..
e se lo provo nel mio host funziona..
come mai ?
avete idee?
grazie mille.
PHP:
<?php
if(!isset($_POST["submit"])){?>
<form action="upload.php" method="POST" enctype="multipart/form-data">
<table align="center">
<tr>
<td align="right">
Server:
</td>
<td>
<input size="50" type="text" name="server" >
</td>
</tr>
<tr>
<td align="right">
Username:
</td>
<td>
<input size="50" type="text" name="user" >
</td>
</tr>
<tr>
<td align="right">
Password:
</td>
<td>
<input size="50" type="password" name="password" >
</td>
</tr>
<tr>
<td align="right">
Path on the server:
</td>
<td>
<input size="50" type="text" name="pathserver" value="" >
</td>
</tr>
<tr>
<td align="right">
Select your file:
</td>
<td>
<input name="userfile" type="file" size="50">
</td>
</tr>
</table>
<table align="center">
<tr>
<td align="center">
<input type="submit" name="submit" value="Upload image" />
</td>
</tr>
</table>
</form>
<?}
else
{
set_time_limit(300);//for uploading big files
$paths=$_POST['pathserver'];
$filep=$_FILES['userfile']['tmp_name'];
$ftp_server=$_POST['server'];
$ftp_user_name=$_POST['user'];
$ftp_user_pass=$_POST['password'];
$name=$_FILES['userfile']['name'];
// set up a connection to ftp server
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection and login result
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has encountered an error!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name....";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name".".....";
}
// upload the file to the path specified
$upload = ftp_put($conn_id, $paths.''.$name, $filep, FTP_BINARY);
// check the upload status
if (!$upload) {
echo "FTP upload has encountered an error!";
} else {
echo "Uploaded file with name $name to $ftp_server ";
}
// close the FTP connection
ftp_close($conn_id);
}
?>
invece nel mio host linux su un'altra hoster .. mi funziona senza modificare lo script.??
Il mio è sul servizio linux su tophost invece quello del mio fratello registrato da anni e su host windows register.
scusatemi se non si possono dire i nomi dei hoster.. ma ho un problema con questo script che nel mio funziona normalmente ma su quello di mio fratello no.
ed in oltre questo lo aggiancio al resize thumb.. solo che lo script si ferma alla login e pure l'ftp sono giuste..
e se lo provo nel mio host funziona..
come mai ?
avete idee?
grazie mille.