flash & PHP: write TXT file from variables
Posted: Sat Oct 11, 2003 11:07 am
Hi everybody!
I'm trying to make someting like a simple news manager using PHP and Flash . . . but I'm having problems with the PHP script (newbie!!)!
Could you help me please??
I have a dynamic textfield in flash file where i can write the news and a button (SEND) that sends the variables to a php script.
What I'd like the php file to do is to create or overwrite a txt file whit the variables collected from flash file. But I'm doing something wrong!
Here's the PHP script:
<?
$fp = fopen ("$text.txt"); // TEXT.TXT IS THE FILE I WANT TO OVERWRITE
fwrite($fp,"$newtext"); // NEWTEXT ARE THE VARIABLES I WANT TO WRITE
fclose($fp);
if ($fp) {
echo ("&erro=NONE&msg=TEXT WRITTEN!");
} else {
echo ("&erro=OK&msg=PROBLEM OCCURRED!");
}
?>
With this script the txt file on my server doesn't change!!!
Do you see mistakes? Or I'm doing it comletely wrong?
I would appreciate your help very much since it's weeks that I keep on reading tutorials & forums without any result . . .
thanks everybody
Nando
I'm trying to make someting like a simple news manager using PHP and Flash . . . but I'm having problems with the PHP script (newbie!!)!
Could you help me please??
I have a dynamic textfield in flash file where i can write the news and a button (SEND) that sends the variables to a php script.
What I'd like the php file to do is to create or overwrite a txt file whit the variables collected from flash file. But I'm doing something wrong!
Here's the PHP script:
<?
$fp = fopen ("$text.txt"); // TEXT.TXT IS THE FILE I WANT TO OVERWRITE
fwrite($fp,"$newtext"); // NEWTEXT ARE THE VARIABLES I WANT TO WRITE
fclose($fp);
if ($fp) {
echo ("&erro=NONE&msg=TEXT WRITTEN!");
} else {
echo ("&erro=OK&msg=PROBLEM OCCURRED!");
}
?>
With this script the txt file on my server doesn't change!!!
Do you see mistakes? Or I'm doing it comletely wrong?
I would appreciate your help very much since it's weeks that I keep on reading tutorials & forums without any result . . .
thanks everybody
Nando