Flash + PHP

I have the folowing situation:

When I run the movie on localhost in a projector the variables load from the *.php file stored on my local computer but when i try to load variables from a web server in a projector the files won’t load with a *.php extenison but when I copy the same content from *.php file to a *.txt file and put the file on the server the variables load. I can’t see why Flash is doing this, if you know the solution please post it here.

stop();
loadVariablesNum("http://www.petagimnazija.hr/ivan/flash.php", 0);
function loaded() {
	if (num == undefined) {
		trace("Variables are not loaded!");
	} else {
		clearInterval(interval_vars);
		trace("Variables are loaded!");
		trace("-----------------------------------");
	}
}
interval_vars = setInterval(loaded, 100);

You can see the output of the php file here

You could always try putting header(“Content-type: text/plain”); in the top of the PHP file, that causes it to act as a *.txt file.

It’s good to see that I’m not yhe only one with the same problem :stuck_out_tongue: Oh, sorry about my english :confused:

Eletric, could you say what headers are necessary exactly?

[]'s
Edu

They are called HTTP headers and a handful of those are always sent to the browser before the actual page. They have information about the page, and the HTTP headers are also those that tells you wether the file exists or not. They send content-type as well, so you know what you’re opening, but you can overwrite it using this nice PHP function.

Hi, Eletric. If possible, can you take a look at my PHP and say if something is necessary? This script is from my stream server (Icecast) and I’m finishing my stream player. On the website works very well, but standalone…

 
<?php
// Fill in your own server information here: 
$customer_server = "MY.SERVER.IP"; 
$customer_port = "PORT"; 
$variable = "current_song"; 
 
$host = "host.statistics"; 
$port = "80"; 
$stats_get_line="GET [http://$host/icecast/text/index.php](http://$host/icecast/text/index.php)?"; 
$stats_get_line.="server=$customer_server&port=$customer_port&variable=$variable HTTP/1.0
"; 
$stats_get_line.="User-Agent: StreamSolutions  (Mozilla Compatible)

"; 
$fp = fsockopen("$host", $port, &$errno, &$errstr, 30); //open connection 
fputs($fp,$stats_get_line); 
while(!feof($fp)) { 
$page .= fgets($fp, 1000); 
} 
fclose($fp); 
$lines=split("
",$page); 
echo "$lines[8]"; 
?>

Thanks a lot for the help :wink: