# Flash + PHP

**URL:** <https://forum.kirupa.com/t/flash-php/185524>\
**Category:** flash\
**Created:** [April 13, 2006, 10:24pm UTC](https://forum.kirupa.com/t/flash-php/185524 "2006-04-13T22:24:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![itoth](https://avatars.discourse-cdn.com/v4/letter/i/c77e96/32.png) [@itoth](https://forum.kirupa.com/u/itoth)\
**Post date:** [April 13, 2006, 10:24pm UTC](https://forum.kirupa.com/t/flash-php/185524/1 "2006-04-13T22:24:40Z")

</div>

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.

```auto
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](http://www.petagimnazija.hr/ivan/flash.php)

---

<div class="post-metadata">

**Author:** ![electricnet](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@electricnet](https://forum.kirupa.com/u/electricnet)\
**Post date:** [April 14, 2006, 4:22pm UTC](https://forum.kirupa.com/t/flash-php/185524/2 "2006-04-14T16:22:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![riot](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@riot](https://forum.kirupa.com/u/riot)\
**Post date:** [April 14, 2006, 4:36pm UTC](https://forum.kirupa.com/t/flash-php/185524/3 "2006-04-14T16:36:42Z")

</div>

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

Eletric, could you say what headers are necessary exactly?

[]'s  
Edu

---

<div class="post-metadata">

**Author:** ![electricnet](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@electricnet](https://forum.kirupa.com/u/electricnet)\
**Post date:** [April 14, 2006, 4:42pm UTC](https://forum.kirupa.com/t/flash-php/185524/4 "2006-04-14T16:42:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![riot](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@riot](https://forum.kirupa.com/u/riot)\
**Post date:** [April 14, 2006, 4:48pm UTC](https://forum.kirupa.com/t/flash-php/185524/5 "2006-04-14T16:48:39Z")

</div>

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…

```auto
 
<?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 😉
