Page 1 of 1

PHP / TXT / FLASH... question

Posted: Mon Jun 30, 2008 7:54 pm
by nightkarnation
Hello!

I was wondering if someone could help me out here:

Im creating a Chat Room with Flash (Actionscript) PHP & TXT

I have a simple doubt that i cant seem to get it right,

Heres the php code i want to get looked at:

Code: Select all

$add2 = "&" . $checker . "=" . $nickname . "&";
 $open = fopen($filename . ".txt", 'a');
 $write = fwrite($open, $add2);
$checker and $nickname values come from Flash also $filename which = users
$checker has for example the value = user1
so this means that $add2 = &user1=NICKNAMEstring&

the txt is called users.txt and has these values:

&user1=&
&user2=&
&user3=Diego&
&user4=&
&user5=Deter&
&user6=&
&user7=Nightkarnation&
&user8=&
&user9=&
&user10=&

So my question is...what do i have to change on my php code in order for the fopen or fwrite function to not to erase all my txt values...just to ONLY replace (in this case) the &user1=& to &user1=WHATEVERNICKNAME& and leave the other user[#] as they are...

Please someone help me out here,
Looking forward for a reply,
Thanx a lot for ur time!