Php help
#1

<?php
global $config;
$local_file = "dmap_feed.json";
$server_file = "/scriptfiles/dmap_feed.json";

$ftp_server = "173.224.220.104"; // Address of FTP server.
$ftp_user_name = "******"; // Username
$ftp_user_pass = "*******"; // Password
#$destination_file = "/scriptfiles";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
"File Downloaded $local_file\n";
} else {
"Desculpe.Servidor Esta Desligado\n";
}
$config['api key']='ABQIAAAAs4hWYZkFgUCmji8OXGEWhRSksbxBFPegAttWA_e4 E3REnVZ2ahTH-L1GBwSzV3-OuBv0_8-shNpqtQ';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>



and the map is not showing pepole, so im not sure, you see anything wrong?

--------------Error Code Found
[21-Feb-2011 23:03:47] PHP Warning: file_get_contents(/vrp-gta.com/servermap/dmap_feed.json) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home/robert40/vrp-gta.com/servermap/fetch_data.php on line 19
Reply
#2

It means it couldn't find the file. Try adding a . to the start of the directory, like so:

PHP код:
$server_file "./scriptfiles/dmap_feed.json"
This makes sure you're working from the current directory.

Also the error is from a different script, since it's about file_get_contents. This appears to be fixable if you specify the full path in the file_get_contents function, like so:

PHP код:
file_get_contents("/home/robert40/vrp-gta.com/servermap/dmap_feed.json"); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)