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.
Writing Variables
Moderator: General Moderators
This:
Should be:
And to use the variable, use:
or depending on your version of PHP. That should help.
Code: Select all
postnettext("http//www.volume54.com/dcy4/app/add.php?", testVariable)Code: Select all
postnettext("http//www.volume54.com/dcy4/app/add.php?variableName", value)Code: Select all
$_GETї'variableName']Code: Select all
$HTTP_GET_VARSї'variableName']I took a look in the lingo reference
try
try
Code: Select all
postnettext("http//www.volume54.com/dcy4/app/add.php","testVariable=what+ever")Code: Select all
<?php
function writefile($filename,$data,$mode)
{
$fp = fopen($filename, $mode);
fwrite($fp, $data);
fclose($fp);
}
function writefile("text.txt",$_POSTї'testVariable'],"a+")
?>