as2 flash8 + php + write file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thosecars82
Forum Commoner
Posts: 94
Joined: Thu Apr 03, 2008 6:31 am
Location: Arganda, Madrid
Contact:

as2 flash8 + php + write file

Post by thosecars82 »

Hello there

I know that my apache server is working. If I browse my script.php file locally through my browser, my script.php file which is in my pc is run and it writes a test.htm file locally. That is the behaviour I expect. Nonetheless, this file is not created when I run this flash sentence: senderLoad.sendAndLoad("script.php",_root.receiveLoad);

On one hand, I have checked that the function receiveLoad.onLoad is actually called. Moreover, if I do something like echo "&var=1" in the script.php file, actually, I can check that this value is being passed correctly to flash. However, the script.php file is not writing like it should for writing the test.htm file. The php code is this:

Code: Select all

 
<?php 
$fp = fopen("test.htm", "w");
ob_start();
echo "&var1=2&"; 
echo "<html><head><title>The text has been written</title></head><body>Hello</body></html>"; 
$html = ob_get_contents(); 
ob_end_clean(); 
fwrite($fp, $html); fclose($fp);
?>
 
On the other hand, it is strange that not only I get the variable var1 returned to flash correctly when my apache server is working but also when apache is not working. I would appreciate any suggestion to be able to tell php to write a file from flash 8 as2.
Thanks a lot.
Post Reply