Page 1 of 1

Writing Variables

Posted: Fri May 24, 2002 11:22 am
by matty41a
Hi all,

I'd really appreciate some help writing my variable to a text file on my server. I'm writing the program in Macromedia Director and using the following code:

on mouseUp me
postnettext("http//www.volume54.com/dcy4/app/add.php?", testVariable)
end

with the PHP:

<?php

function writefile("text.txt","$testVariable","a+")

{

$fp = fopen($filename, $mode);

fwrite($fp, $data);

fclose($fp);

}

?>

Can anyone tell me why this wont work? The variable is named testVariable in Director.

All input is greatly appreciated!!

Many thanks.

Posted: Fri May 24, 2002 12:50 pm
by jason
This:

Code: Select all

postnettext("http//www.volume54.com/dcy4/app/add.php?", testVariable)
Should be:

Code: Select all

postnettext("http//www.volume54.com/dcy4/app/add.php?variableName", value)
And to use the variable, use:

Code: Select all

$_GET&#1111;'variableName']
or

Code: Select all

$HTTP_GET_VARS&#1111;'variableName']
depending on your version of PHP. That should help.

Posted: Fri May 24, 2002 1:04 pm
by volka
I took a look in the lingo reference
try

Code: Select all

postnettext("http//www.volume54.com/dcy4/app/add.php","testVariable=what+ever")

Code: Select all

&lt;?php
function writefile($filename,$data,$mode)
{ 
   $fp = fopen($filename, $mode); 
   fwrite($fp, $data); 
   fclose($fp); 
} 
function writefile("text.txt",$_POST&#1111;'testVariable'],"a+")
?&gt;