Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 01:07
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic:  (Read 1157 times)
sergio
Server what's that
*
Posts: 3



View Profile Email
« on: 04/23/02, 13:22 »

FLASH PHP doesnt update properly

hi there, I am writing in a text file and then receiving the data in a Flash text field using PHP http://www.reitera.net/mmmphp/aver.swf i know it's quite lame, but it is just a test.

Couldnt fine a way to work it out, so a made something bad in onEnterFrame as you might see.

AS


Code:




envia.onRelease = function ()
{ enviando = "si";
estado = "enviando";
  loadVariablesNum ("escribir.php", 0 , "POST");
 }

carga = function () {
cargatexto = new LoadVars();
cargatexto.load("escribir.php");
cargatexto.onLoad = function (succes) {
if (succes) {
   {display.html = true;
    display.htmlText= this.output;
    }
}
   }}
   carga();
   this.onEnterFrame = function ()
   {if (estado == "escrito") {
      estado = "escrito";
   carga();
   
   }}



PHP


Code:

<?
$archivo = "escribir.txt";
$fs = filesize($archivo);
    $fp = fopen($archivo, "r");
    $salida = fread($fp, $fs);
    echo"&output=$salida";
    fclose($fp);
if ($enviando == "si")
{
$fs = filesize($archivo);
$fp = fopen ($archivo, "r");
if ($fp)
{
$antiguo = fread($fp, $fs);
fclose($fp);}

$fw = fopen($archivo, "w+");
if ($fw)
{echo"&estado=escribiendo";
 fwrite($fw, "$entrada$antiguo");

 $fc = fclose($fw);
   if ($fc)
 {echo"&estado=escrito";}
 
}  
}

?>




I am sorry about the Spanish variables names.

Any ideas?


__________________
www.reitera.net
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!