Jump to content

PHP / txt / flash... question


nightkarnation

Recommended Posts

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:

 

 

$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 values/strings as they are...

 

Please someone help me out here,

Looking forward for a reply,

Thanx a lot for ur time!

Link to comment
https://forums.phpfreaks.com/topic/112689-php-txt-flash-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.