This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-11-23 17:52:58

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Just wondering....

...How do you do a php script that writes to a file the current file plus some more text.
Basically:
(Join (testing.txt) and (hello world)
^Scratch block form

Offline

 

#2 2010-11-23 21:30:36

AnimeCreatorArtist
Scratcher
Registered: 2010-05-25
Posts: 1000+

Re: Just wondering....

seven


http://images2.wikia.nocookie.net/__cb20121209020158/adventuretimewithfinnandjake/images/9/93/Prismo.png
I'm basically honorary nasty. N-n-n-n-nasty jazz

Offline

 

#3 2010-11-23 21:46:28

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: Just wondering....

Seven?

On topic: Idk anything about php, sorry.

Offline

 

#4 2010-11-23 22:25:10

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Just wondering....

I don't know how too write to a file but I know how to right to a database. It would be something like this.

Open database.
Search/ query database for name (Lets just say you saved stuff to it and had a name column) and get value
$oldvalue = Query value
$newvalue = $_Post[newvalue]
$oldvalue <-- $oldvalue & $newvalue
Query database to find row number.
Insert new value at the row.


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#5 2010-11-24 16:52:38

majormax
Scratcher
Registered: 2008-04-06
Posts: 1000+

Re: Just wondering....

@AnimeCreatorArtist: What????

what-the wrote:

I don't know how too write to a file but I know how to right to a database. It would be something like this.

Open database.
Search/ query database for name (Lets just say you saved stuff to it and had a name column) and get value
$oldvalue = Query value
$newvalue = $_Post[newvalue]
$oldvalue <-- $oldvalue & $newvalue
Query database to find row number.
Insert new value at the row.

So it'd be like this:
http://www.majorrom.com/personalfilehosting/phpex.gif
(in PHP writing to a file clears all the text then writes)(pic from panther)
So if test.txt was originally "I like" then it would be "I like cheese"?

Offline

 

Board footer