Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,047 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,535 people online right now. Registration is fast and FREE... Join Now!




More Txt Stuff

 
Reply to this topicStart new topic

More Txt Stuff

this-id-not-nickwills
21 Nov, 2002 - 03:34 PM
Post #1

New D.I.C Head
*

Joined: 19 Nov, 2002
Posts: 8

ok. i made a page with a form that writes the text in a textbox to a txt file. but it just adds on to the end of the txt file. is there a way to delete the text and just have the new text that in the box?
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: More Txt Stuff
21 Nov, 2002 - 03:36 PM
Post #2

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
ok, let me see if i get what you mean, you're writing text to a file and it just keeps adding to the file and what you want is for the file to be erased before it's written to?
User is offlineProfile CardPM
+Quote Post

this-id-not-nickwills
RE: More Txt Stuff
21 Nov, 2002 - 03:38 PM
Post #3

New D.I.C Head
*

Joined: 19 Nov, 2002
Posts: 8

bingo man.

i made a flash page that pulls its news from the txt file.
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: More Txt Stuff
21 Nov, 2002 - 03:40 PM
Post #4

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
ok, so are you using this php function:
CODE

$fp = fopen ("file", "r");

User is offlineProfile CardPM
+Quote Post

this-id-not-nickwills
RE: More Txt Stuff
21 Nov, 2002 - 03:52 PM
Post #5

New D.I.C Head
*

Joined: 19 Nov, 2002
Posts: 8

i was actually using
CODE
$fp = fopen ("file", "a");

User is offlineProfile CardPM
+Quote Post

this-id-not-nickwills
RE: More Txt Stuff
21 Nov, 2002 - 03:59 PM
Post #6

New D.I.C Head
*

Joined: 19 Nov, 2002
Posts: 8

fyrestorm, you're a genius. i set it to


$fp = fopen ("file", "w+");

and everything worked out super.

thanks man.
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: More Txt Stuff
21 Nov, 2002 - 04:04 PM
Post #7

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
no prob man, glad i can help you
User is offlineProfile CardPM
+Quote Post

gneato
RE: More Txt Stuff
21 Nov, 2002 - 07:12 PM
Post #8

<title>Untitled Document</title>
*****

Joined: 3 Sep, 2001
Posts: 1,311

"man"

hehe

the way we assume...
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: More Txt Stuff
22 Nov, 2002 - 10:12 AM
Post #9

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
QUOTE(gneato @ Nov 21 2002, 09:12 PM)
"man"

hehe

the way we assume...

hehe cool.gif


most of the time i'm right in my assumptions....
User is offlineProfile CardPM
+Quote Post

nickwills
RE: More Txt Stuff
22 Nov, 2002 - 10:49 AM
Post #10

ive told capty to change this 30k times, but he's a fag
***

Joined: 5 Sep, 2002
Posts: 482


My Contributions
QUOTE(fyrestorm @ Nov 22 2002, 12:12 PM)
QUOTE(gneato @ Nov 21 2002, 09:12 PM)
"man"

hehe

the way we assume...

hehe cool.gif


most of the time i'm right in my assumptions....

and i was super glad you made the assumption. it clicked with me and now everything works out super.
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: More Txt Stuff
23 Nov, 2002 - 07:23 AM
Post #11

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
QUOTE(nickwills @ Nov 22 2002, 12:49 PM)
QUOTE(fyrestorm @ Nov 22 2002, 12:12 PM)
QUOTE(gneato @ Nov 21 2002, 09:12 PM)
"man"

hehe

the way we assume...

hehe cool.gif


most of the time i'm right in my assumptions....

and i was super glad you made the assumption. it clicked with me and now everything works out super.

i'm glad that i could help you out, but when talking about assumptions i was referring to the 'gender' assumption
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 05:14PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month