Hi all
I am a PHP noob, but have some experience from Pascal coding. However I am creating a stats program for a game. Somebody on the net has send me an FTP login script, that can log in to my game server. The script seems to work fine, the problem is, that some of the folders are hidden folders. And I need to acess one of the hidden folders in order to get the game log file. Here is the script:
//** FTP and filelocation settings
$server_file = '/games/g2737739/.callofduty/uo/games_mp.log'; //path and name of your gameserver logfile
$ftp_server = "xx.xxx.xx.xxx"; //name or IP for your gameserver
$ftp_user_name = "XXX"; //ftp user name
$ftp_user_pass = "XXX"; // ftp user password
$logfile .= "establish connection to $ftp_server FTP server\n";
if ($conn_id = ftp_connect($ftp_server)) {
$logfile .= "connected to: ".$ftp_server."\n";
}else{
$logfile .= "----------------------------------------------------------------------------------\n";
$logfile .= "ATTENTION: SCRIPT TERMINATED IRREGULAR !!!!\n";
$logfile .= "----------------------------------------------------------------------------------\n";
$logfile .= "can't establish connection to ".$ftp_server." FTP server\n";
exit();
}
//FTP login with username and password
if ($login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass)) {
$logfile .= "Logged on to ".$ftp_server."\nUser: ".$ftp_user_name."\nPass: ".$ftp_user_pass."\n";
}else{
$logfile .= "----------------------------------------------------------------------------------\n";
$logfile .= "ATTENTION: SCRIPT TERMINATED IRREGULAR !!!!\n";
$logfile .= "----------------------------------------------------------------------------------\n";
$logfile .= "Can't logon as User: ".$ftp_user_name."<br>Pass: ".$ftp_user_pass."\n";
write_logfile($logfile);
exit();
}
//try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY))
{
$logfile .= "Successfully written to $local_file\n";
if(ftp_delete($conn_id, $server_file))
{
$logfile .= "Logfile on FTP server was deleted successful!\n";
}
else
{
$logfile .= "Logfile on FTP server could not be deleted!\n";
}
} else {
$logfile .= "----------------------------------------------------------------------------------\n";
$logfile .= "ATTENTION: SCRIPT TERMINATED IRREGULAR !!!!\n";
$logfile .= "----------------------------------------------------------------------------------\n";
$logfile .= "There was a problem - cant download the logfile from FTP Server!\n";
write_logfile($logfile);
unlink ($local_file);
exit();
}
//close the FTP connection
if ($conn_id) {
ftp_close($conn_id);
}
}
$logfile .= "
Aparently these two folders are hidden folders: .callofduty/uo/
How do I make the script see/find the hidden folders, exactly?
Thanks a bunch