Hello
I wanted to edit/make and delete files and directories on a server with php/phpftp
here is a cut of my code but the prob in the is that when ever the file exist he cant edit it, and the second prob is that the file must lay in the same directory or i have to give him the full path, what i don´t want.
Here is the code:
<?php
// Herstellen der Basis-Verbindung
$conn_id = ftp_connect("$server");
// Einloggen mit Benutzername und Kennwort
$login_result = ftp_login($conn_id, "$user", "$pw");
// Verbindung überprüfen
if ((!$conn_id) || (!$login_result))
{
echo "Ftp-Verbindung nicht hergestellt!";
echo "Verbindung mit $server als Benutzer $user nicht möglich";
die;
} else {
echo "Verbunden mit $server als Benutzer $user ";
echo "<br>";
// öffnen/erstellen der datei
$fd = fopen"/test.html","a");
if ($fd)
{
$str = "trage diese daten ein";
fwrite($fd, $str);
fclose($fd);
print"Daten eingetragen / geändert!";
}
else
{
print"Da is nen fehler";
}
}
?>
is there any other way to solve this prob???
THX