...

View Full Version : Help simple script



itsonlyme80
07-19-2011, 04:29 PM
Hi,

I need a very simple script that will do the following :

I have a HTML form.
I have an input call "title". Say I wrote "fleur-de-lys"
I have a text area call "text"

When I hit the submit button I want to do :

1. Create a HTML webpage with the name in input :
fleur-de-lys.html
2. Add the text in "text" somewhere in the body of that new file fleur-de-lys.html
3. Add a preview of that text somewhere in my index page

Basically it's like you post a new article on wordpress or whatever, but I just want something simple no database and just need help on how I do this.

Thank you very much

Philip M
07-21-2011, 09:02 AM
It is not possible to create an HTML page using Javascript.

JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

devnull69
07-21-2011, 10:01 AM
JavaScript [...] has no capability to read from [...] a file

It has, with the new file api. But the user has to choose the file. Javascript can not access a "random" file.

itsonlyme80
07-21-2011, 05:46 PM
Thanks for the replies. Do you have any suggestions how I should proceed?

Old Pedant
07-22-2011, 01:14 AM
Yes. Use a server-side language to do this, where it is quite easy.

ASP, JSP, PHP, etc. Your choice.

XterM
07-22-2011, 02:12 AM
ajax supported to do this issue

Old Pedant
07-22-2011, 02:24 AM
ajax supported to do this issue

Sure, but you still need to learn and use a server-side language to handle the AJAX call.

Personally, I doubt that AJAX has any advantage at all in answering this problem. It can be used, but it's overkill.

XterM
07-22-2011, 02:30 AM
Sure, but you still need to learn and use a server-side language to handle the AJAX call.

Personally, I doubt that AJAX has any advantage at all in answering this problem. It can be used, but it's overkill.

that's right. but not too kill if have basic of clientside and serverside programming. :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum