PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Try using the 'a' flag with fopen instead of the 'w' flag. The 'a' flag will move the file pointer to the end of the file so you can add (or append) to the file.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
@social_experiment: actualy what i want is the file to be rewritten! Though i already tried the 'a' flag
but i 've to wait for ages to download the newly edited file(it always gives me the last downloaded(before editing) file)
if you could spare me a minute here is the link http://loneapps.net16.net/loneapps/webpad/webpad.html
(please use a phone's browser as it is designed for small displays)
evan_lone wrote:but i 've to wait for ages to download the newly edited file(it always gives me the last downloaded(before editing) file)
I tested it and it opened pretty quickly after i entered a quote, and it displayed the last value i entered
i m a bad speaker, pardon me for writing too long, say i entered the qoute 'hello' first time i enter the site and download it the downloaded files contents will be 'hello' but if i again enter another value say 'bye' and download it the file's contents won't be 'bye' instead it would come as 'hello' which is the value i just entered before.
I've tried many things but every time i end up with the same problem or an err msg.
Of course you will get the new file but like i said only after waiting for the 'server to refresh' try it.
evan_lone wrote:say i entered the qoute 'hello' first time i enter the site and download it the downloaded files contents will be 'hello' but if i again enter another value say 'bye' and download it the file's contents won't be 'bye' instead it would come as 'hello' which is the value i just entered before.
I entered submitted the form with default content and when i viewed the text file i saw the correct text, then i used my browser button to go back and entered a new value, which when submitted and viewed is displayed correctly. I couldn't recreate the problem you describe.
evan_lone wrote:I've tried many things but every time i end up with the same problem or an err msg.Of course you will get the new file but like i said only after waiting for the 'server to refresh' try it.
Can you paste the error message if you receive it. If i receive the new message i entered i would assume the script is working. I don't quite understand what you mean by 'server to refresh' but i would say that's normal because the script is writing to a file which might take time.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
or is it my device that is wrong!?
But what i guess(as a newbie) is that it is the server that is slow.
But thanks so much for givin' your precius time out here!
Regards.
evan_lone wrote:or is it my device that is wrong!?But what i guess(as a newbie) is that it is the server that is slow.
It's possible that the connection is slow, what type of connection do you use through the device?
oh, we dont have fast connection here in manipur, but i used edge connection, its pretty fast. And of course the 'congrates ! Your file is saved here'(hope you get me) page loads really fast so as the download. Did you got the file downloaded or displayed on the browser's window ? Once i managed the file to be displayed but at that time there was no problems, the browser always instantly displayed corectly every time i summit.