Problem with the code?

  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

I am passing values to php like this and writting those values to a same text file.

coding.send("http://localhost:8080/dogyears2.php","blank");
nop.send( "http://localhost:8080/dogyears1.php","blank");
lvOut.send( "http://localhost:8080/dogyears.php","blank");

values in coding and lvOut are printed fine in the file but not the nop values.
I am facing this problem in the firefox browser, when I use IE this works perfectly fine.


Can you guide me whats wrong here.
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

any php sessions involved here ?
  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

thanks man , can you please specify what do you mean php session.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

actually, i see no reason for that code not to work, unless you don't fill correctly the variable nop.
Trace the variable just before using it, to make sure it's declared, then trace some attributes of it, to make sure it's filled.
Code: [ Select ]
coding.send("http://localhost:8080/dogyears2.php","blank");
trace(nop); // -> should not display undefined
trace(nop.variable1); // -> should display the value of that variable u filled
nop.send( "http://localhost:8080/dogyears1.php","blank");
lvOut.send( "http://localhost:8080/dogyears.php","blank");
  1. coding.send("http://localhost:8080/dogyears2.php","blank");
  2. trace(nop); // -> should not display undefined
  3. trace(nop.variable1); // -> should display the value of that variable u filled
  4. nop.send( "http://localhost:8080/dogyears1.php","blank");
  5. lvOut.send( "http://localhost:8080/dogyears.php","blank");

Also, make sure there is a dogyears1.php file and works correctly.
I can't see other problems than these.
  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

Thanks man , I have checked it with the tracing . The thing is it works fine with the Internet explorer but not with the firefox.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

the flash<->php communication should not be browser related ... but who knows.
Anyway, can you post the declaration and filling of the nop variable, also the php code for dogyears1.php?
  • crosnake
  • Newbie
  • Newbie
  • crosnake
  • Posts: 6

Post 3+ Months Ago

makhan wrote:
I am passing values to php like this and writting those values to a same text file.

coding.send("http://localhost:8080/dogyears2.php","blank");
nop.send( "http://localhost:8080/dogyears1.php","blank");
lvOut.send( "http://localhost:8080/dogyears.php","blank");

values in coding and lvOut are printed fine in the file but not the nop values.
I am facing this problem in the firefox browser, when I use IE this works perfectly fine.


Can you guide me whats wrong here.




same problem
  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

Here is the code for the dogyears1.php



<?php
//echo "$_POST["lineat"]";
//echo "result=".$_POST['parameters'];


$myFile = "inputstomatlab.txt";
$fh = fopen($myFile, 'a') or die("can't open file");

fwrite($fh,$_POST['parameters']);
fwrite($fh,"\n");

fclose($fh);


?>
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

weird, it works ok for me.
Code: [ Select ]
var coding:LoadVars = new LoadVars();
var nop:LoadVars = new LoadVars();
var lvOut:LoadVars = new LoadVars();

coding.parameters = "coding: test write";
nop.parameters = "nop: test write";
lvOut.parameters = "lvOut: test write";


btnWrite.onRelease = function()
{
    coding.send("http://localhost:8080/MyClasses/write1.php","blank");
    nop.send( "http://localhost:8080/MyClasses/write2.php","blank");
    lvOut.send( "http://localhost:8080/MyClasses/write3.php","blank");
}
  1. var coding:LoadVars = new LoadVars();
  2. var nop:LoadVars = new LoadVars();
  3. var lvOut:LoadVars = new LoadVars();
  4. coding.parameters = "coding: test write";
  5. nop.parameters = "nop: test write";
  6. lvOut.parameters = "lvOut: test write";
  7. btnWrite.onRelease = function()
  8. {
  9.     coding.send("http://localhost:8080/MyClasses/write1.php","blank");
  10.     nop.send( "http://localhost:8080/MyClasses/write2.php","blank");
  11.     lvOut.send( "http://localhost:8080/MyClasses/write3.php","blank");
  12. }

even if i have only one file named write.php and i call it for all send methods, it works.
output file is:
coding: test write
nop: test write
lvOut: test write

The php files (write1.php, write2.php, write3.php) have the code you gave me:
Code: [ Select ]
<?php
echo "params=".$_POST['parameters'];
$myFile = "inputstomatlab.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh,$_POST['parameters']);
fwrite($fh,"\n");
fclose($fh);
?>
  1. <?php
  2. echo "params=".$_POST['parameters'];
  3. $myFile = "inputstomatlab.txt";
  4. $fh = fopen($myFile, 'a') or die("can't open file");
  5. fwrite($fh,$_POST['parameters']);
  6. fwrite($fh,"\n");
  7. fclose($fh);
  8. ?>


I noticed something in firefox about calling php files from flash. If you don't use the calling code (lv.send, getURL etc) in a onRelease statement, then the windows that should be displayed are considered as popups and are blocked.
  • makhan
  • Novice
  • Novice
  • makhan
  • Posts: 31

Post 3+ Months Ago

Thanks man

Portion of My code is like

this.onMouseDown=function(){
if(!mouseDownCount){
mouseDownCount=1;
} else {
mouseDownCount++;
}
if(Number(iTF)>mouseDownCount){
selectedColor._x=_root._xmouse;
selectedColor._y=_root._ymouse-20; // you'll need to adjust this when the mousedown is near the stage top
myNewColor = "0x" + copy_bmpd.getPixel(_xmouse,_ymouse).toString(16);
lineat.push([_xmouse,_ymouse]);
lvOut.lineat= lineat.join("|");
//trace(lineat);
//sendvalue();
newColor.setRGB(myNewColor);
selectedColor.colorValue.text = myNewColor;

}
if(Number(iTF-1)==(mouseDownCount)){

sendvalue();
}
}

}


function sendvalue(){
trace(coding);
trace(nop);
trace(lvOut);
coding.send("http://localhost:8080/dogyears2.php","blank");
nop.send( "http://localhost:8080/dogyears1.php","blank");
lvOut.send( "http://localhost:8080/dogyears.php","blank");

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 3 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.