Dynamic textfile problem

  • biggie
  • Novice
  • Novice
  • biggie
  • Posts: 18
  • Loc: UK

Post 3+ Months Ago

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:

Code: [ Select ]
&loaded=yes&
&speed=30&
&txt1="Text1"&
&txt2="text goes here"&
&txt3="and here"&
&txt4="Here too"&
&txt5="Finally here"&
  1. &loaded=yes&
  2. &speed=30&
  3. &txt1="Text1"&
  4. &txt2="text goes here"&
  5. &txt3="and here"&
  6. &txt4="Here too"&
  7. &txt5="Finally here"&


After typing in these boxes the user can click 'Save' which links to the writeFile.php:

Code: [ Select ]
<?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);

?>
  1. <?php
  2. $filename = "texteffect.txt";
  3. $fd = fopen ($filename, "w");
  4. $myText= "&loaded=yes&" . "\r\n";
  5. $myText.= "&speed=30&" . "\r\n";
  6. $myText.= "&txt1=" . $line1. "&" . "\r\n";
  7. $myText.= "&txt2=" . $line2. "&" . "\r\n";
  8. $myText.= "&txt3=" . $line3. "&" . "\r\n";
  9. $myText.= "&txt4=" . $line4. "&" . "\r\n";
  10. $myText.= "&txt5=" . $line5. "&" . "\r\n";
  11. fputs ($fd, $myText);
  12. fclose ($fd);
  13. ?>



This should input the text into the textfile including the user inputted text.

However for some reason the text file ends up like this,

Code: [ Select ]
&loaded=yes&
&speed=30&
&txt1=&
&txt2=&
&txt3=&
&txt4=&
&txt5=&
  1. &loaded=yes&
  2. &speed=30&
  3. &txt1=&
  4. &txt2=&
  5. &txt3=&
  6. &txt4=&
  7. &txt5=&


Ive no idea why it isnt placing the user inputted text into the file?

Any ideas?

thanks for help with this!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • neuro productions
  • Newbie
  • Newbie
  • neuro productions
  • Posts: 6

Post 3+ Months Ago

whats your code for linking to the php?

you should use sendAndLoad for something like this

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 21 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.