Hejsan !
Jag har en hemsida på ett webhotell. Från min hemsida där skulle jag vilja se status på min ftp server tex mm den är online eller offline & uptime. någon som har en bra php kodning för detta ?
/Force
Se ftp server status på min hemsida.
- forcevision
- Posts: 418
- Joined: 2007-06-17 11:21:44
- Location: Göteborg
Prova:
http://se.php.net/manual/en/function.ftp-connect.php
Code: Select all
if (!ftp_connect(host.se, 21, 2)) { echo "FTP är nere."; }
The three most dangerous things in the world are a programmer with a soldering iron, a hardware type with a program patch and a user with an idea.
In theory, there is no difference between theory and practice. But, in practice, there is.
In theory, there is no difference between theory and practice. But, in practice, there is.
- forcevision
- Posts: 418
- Joined: 2007-06-17 11:21:44
- Location: Göteborg
Absolut det skall jag göra hur skriver jag för att det skall stå om ftp servern är online ?nva wrote:Prova:http://se.php.net/manual/en/function.ftp-connect.phpCode: Select all
if (!ftp_connect(host.se, 21, 2)) { echo "FTP är nere."; }
Code: Select all
if ( ftp_connect("my.host.se", 21, 2) )
{
echo "FTP är uppe...";
}
else
{
echo "FTP är nere...";
}
Code: Select all
echo "FTP är ".( (ftp_connect("my.host.se", 21, 2)) ? "uppe" : "nere" )."...";
. .. ... .... ..... ...... ....... ....... ..........