Zeek
01-14-2002, 09:20 PM
I want to call an PHP3-script out of action-script (with sending an
variable "person") and get back another variable (depending on
the first) to use in ActionScript.
To do this I used:
>>
person="bob"
loadVariablesNum ("get.php3", 0, "GET");
<<
in ActionScript. The PHP3-script does the following:
>>
clearstatcache ();
$exist = "";
$exist = file_exists ("$person.txt");
if ($exist == 1){
$lines = file("$person.txt");
$output = trim($lines[0]);
/* I need the first line only and want to drop the rest */
echo("&newmessage=$output");}
<<
Now I want to use the variable "newmessage" in ActionScript. I
created a text field "text" (multi line, html) and added the
following code to a button:
>>
on (release) {
text+=newmessage;
} /*to append the text to the existing.*/
<<
All that seems to work.. but the problem I have is, that the
output seems to be a bit buggy by linefeeds.
e.g. If the content of "bob.txt" (which the PHP will read out)
is "Hello world<br>" (not more not less) and I click the button for
three times, my text field looks like:
>>
Hello world
Hello world
Hello world
>>
But it should look like:
>>
Hello world
Hello world
Hello world
<<
If I call the PHP3-script in my browser by typing
"www.domain.com/script.php3?name=bob" I get back:
>>
Hello world
<<
So where do the linefeeds come from and what can I do to
remove them? Please help! :confused:
Zeek
variable "person") and get back another variable (depending on
the first) to use in ActionScript.
To do this I used:
>>
person="bob"
loadVariablesNum ("get.php3", 0, "GET");
<<
in ActionScript. The PHP3-script does the following:
>>
clearstatcache ();
$exist = "";
$exist = file_exists ("$person.txt");
if ($exist == 1){
$lines = file("$person.txt");
$output = trim($lines[0]);
/* I need the first line only and want to drop the rest */
echo("&newmessage=$output");}
<<
Now I want to use the variable "newmessage" in ActionScript. I
created a text field "text" (multi line, html) and added the
following code to a button:
>>
on (release) {
text+=newmessage;
} /*to append the text to the existing.*/
<<
All that seems to work.. but the problem I have is, that the
output seems to be a bit buggy by linefeeds.
e.g. If the content of "bob.txt" (which the PHP will read out)
is "Hello world<br>" (not more not less) and I click the button for
three times, my text field looks like:
>>
Hello world
Hello world
Hello world
>>
But it should look like:
>>
Hello world
Hello world
Hello world
<<
If I call the PHP3-script in my browser by typing
"www.domain.com/script.php3?name=bob" I get back:
>>
Hello world
<<
So where do the linefeeds come from and what can I do to
remove them? Please help! :confused:
Zeek