Forum Moderators: open

Message Too Old, No Replies

Generate page from user input

         

badboy70

11:51 am on Dec 24, 2008 (gmt 0)

10+ Year Member



Hey
I'd like to know if it's possible to use Javascript, so a user can input lines of text ( eg name, picture),
so that the user inputs his name and the picture will automatically be seen ( this is optional)

but the main thing should be that from the user input, a webpage is automatically stored as HTML.
Example:

A user types his name : John
and a link to an image : http://www.example.com/ocean-turtle.jpg

Then a webpage is stored in the folder UserInput.

The generated webpage will be named Johnhttp://www.example.com/ocean-turtle.jpg.html

And the page will look like this when opened :

-----

Your name is John

You have uploaded this image:
( the image is automatically displayed, but if this isn't optional just the link to it is ok too )
------

OPTIONAL ('cause it'll save me some work )

And if possible maybe the page can be added to a dynamic page, like this

Quote:
Users

John
Anna
...
And the names are linked to the corresponding page.

[edited by: coopster at 1:08 pm (utc) on Dec. 24, 2008]
[edit reason] please use example.com [/edit]

Trace

3:33 pm on Dec 24, 2008 (gmt 0)

10+ Year Member



JavaScript is not what you are looking for. Sounds like it might be time to start reading up on some server-side languages. There's a lot to chose from so do your research before committing yourself.

Here's a good place to start;
[google.ca...]

abhilash cherukat

6:34 pm on Dec 24, 2008 (gmt 0)

10+ Year Member



With my understanding to your question

You r trying like When a user type a name his photo should be displayed right?

Then on the click event of a button
write javascript to reload the page and give the name of the picture file as the persons name

and give

document.getElementById('Pic')+src="C:/" .document.getElementById('nameTxt').value + ".jpg"

This will work i think

[edited by: eelixduppy at 6:48 pm (utc) on Dec. 24, 2008]
[edit reason] no signatures, please [/edit]

rocknbil

8:36 pm on Dec 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



document.getElementById('Pic')+src="C:/" .document.getElementById('nameTxt').value + ".jpg"

I just went through this with a client (again) last night. It works only in IE6, and really is a security flaw. What you are asking is to allow the browser to read local files on your computer, then display them in the browser using Javascript. Imagine what a nefarious coder could do with such a tool; this is why we can't read the value of the input type="file" field.

This convenient behavior appears to be squashed in IE 7. Additionally, when you say "upload" and "create HTML page" you are asking as Trace says - something to be uploaded to a server ,which is a different matter entirely.