Hi,
Im having a little problem with my code that writes to a text file dynamically.
It has worked before but for some reason does not work now.
I have a 5 input boxes in flash var named line1,line2,line3 etc.... There is text already in these boxes that the user can edit if they wish from this txt file:
&loaded=yes&
&speed=30&
&txt1="Text1"&
&txt2="text goes here"&
&txt3="and here"&
&txt4="Here too"&
&txt5="Finally here"&
- &loaded=yes&
- &speed=30&
- &txt1="Text1"&
- &txt2="text goes here"&
- &txt3="and here"&
- &txt4="Here too"&
- &txt5="Finally here"&
After typing in these boxes the user can click 'Save' which links to the writeFile.php:
<?php
$filename = "texteffect.txt";
$fd = fopen ($filename, "w");
$myText= "&loaded=yes&" . "\r\n";
$myText.= "&speed=30&" . "\r\n";
$myText.= "&txt1=" . $line1. "&" . "\r\n";
$myText.= "&txt2=" . $line2. "&" . "\r\n";
$myText.= "&txt3=" . $line3. "&" . "\r\n";
$myText.= "&txt4=" . $line4. "&" . "\r\n";
$myText.= "&txt5=" . $line5. "&" . "\r\n";
fputs ($fd, $myText);
fclose ($fd);
?>
- <?php
- $filename = "texteffect.txt";
- $fd = fopen ($filename, "w");
- $myText= "&loaded=yes&" . "\r\n";
- $myText.= "&speed=30&" . "\r\n";
- $myText.= "&txt1=" . $line1. "&" . "\r\n";
- $myText.= "&txt2=" . $line2. "&" . "\r\n";
- $myText.= "&txt3=" . $line3. "&" . "\r\n";
- $myText.= "&txt4=" . $line4. "&" . "\r\n";
- $myText.= "&txt5=" . $line5. "&" . "\r\n";
- fputs ($fd, $myText);
- fclose ($fd);
- ?>
This should input the text into the textfile including the user inputted text.
However for some reason the text file ends up like this,
&loaded=yes&
&speed=30&
&txt1=&
&txt2=&
&txt3=&
&txt4=&
&txt5=&
- &loaded=yes&
- &speed=30&
- &txt1=&
- &txt2=&
- &txt3=&
- &txt4=&
- &txt5=&
Ive no idea why it isnt placing the user inputted text into the file?
Any ideas?
thanks for help with this!