View Full Version : Write() code saves to that page?

05-18-2007, 02:10 AM
Is there anyway that when I use the "Write()" and write some information to another page, that the page it is written to will keep that information until I delete it? I am not sure if this can be accomplished with Javascript or if I will need PHP. I hope it can with Javascript. One example of this could be used for is have a form for writing a comment about the page. Whatever was typed into the comment text box would be saved as a variable and that written to another page that has a Prompt box that asks for a password so only the person with the password could view it. Is this possible with Javascript? Thanks in advance! Also if this is, I'm kinda new to the Write() command so if someone could clarify on how to use it (i.e. when it can and can't be used, what must be done before hand [such as do you have to open the page before you can write to it] and that sort of thing. Thanks!)

05-18-2007, 04:15 AM
No its not possible with javascript. You'll need to do it serverside.

05-18-2007, 04:19 AM
The write() command in JavaScript is the old way of writing content into a web page. It only works for HTML and not XHTML and only if run before the page finishes loading (otherwise it starts creating a new page.

It has been superceded by innerHTML and the various DOM commands and no longer needs to be used at all.

05-18-2007, 04:22 AM
I think if you are going for some type of comment system then look for a premade one. Don't try to reinvent the wheel especially if you barely even know php. www.hotscripts.com has some good ones.