Log in

View Full Version : HTML Generator Window Thingy



cherylsaynhi
10-26-2007, 09:38 PM
I don't really know what it's called. You know how when you go to a generator site, and it generates (whatever) and gives you the HTML to cut/copy/paste? I am looking for a script in HTML that will allow me to place that on my site with my own HTML coding inside for people to copy. Can anyone help me? An example of what I'm asking for is here: http://www.glittertextgenerator.net/index.php See the little boxes w/ HTML in them for people to copy?? That's what I want.

THanks! :o)

PS: You may have to retype something and hit "Do It!" before you'll see what I'm talking about). For some reason, it doesn't save to the original page I posted. :(

djr33
10-26-2007, 09:46 PM
That's complex, but not too difficult, once you have the server side code started.

Using PHP, you could do this, as with ASP, etc.

You can send the form data to the page, and get that data; then for each letter, output the image tag/src, then print all of that and place it in a box.

cherylsaynhi
10-26-2007, 09:48 PM
Thanks, but..... HUH??? I want to put this code on a "free" site. (Freewebs, to be exact). i don't want letters. The letters thing was just an example. What I'm actually speaking of is the ACTUAL BOX that contains HTML that people copy to paste in their own myspace, or whatever.

djr33
10-26-2007, 09:53 PM
The box is just a textarea within a form:

<form .....>
<textarea .....>any text you want goes here including any html tags</textarea>
</form>Replace the .....s with parameters, like the action of the form and the styling.

I'm not sure if you want more info because the site you linked to is quite complex. It has a form, yes, but you would also need to generate the result for that. Just having the form doesn't need any server side code, though.
Also, freewebs doesn't support PHP, etc., so you won't be able to make a generator. You can, though, have a textbox from which you can cut/paste code.


Note: the reason it doesn't "save the original page" is that it is a PHP script that checks if the form has been sent (and if the info is valid). If so, it generates the preview and the textboxes. If it wasn't sent, then you get no form displayed.

cherylsaynhi
10-26-2007, 09:56 PM
Ok, thank you. Yeah, I don't want a generator -- just the box thingy w/ the HTMl in it for people to highlight and copy. But I can use what you typed out, though, right?? (I hope)? As far as parameters, does that include the size of the HTML box? How would I do that? Do I need quotes and/or spaces, etc.?

djr33
10-26-2007, 09:57 PM
<textarea cols="10" rows="40">any code you want</textarea>

cols is the number of columns; rows is the number of rows of characters. rows are taller than cols are wide; that [10x40] may be roughly square... just a guess.

cherylsaynhi
10-26-2007, 10:01 PM
Ok, thanks so much! I'll try that and let you know how it turns out. :)

cherylsaynhi
10-26-2007, 10:12 PM
OK... What was I supposed to put after <form .....> ?

djr33
10-27-2007, 06:40 AM
Well, a form is a section of the page with inputs, like textareas, checkboxes, textboxes, and submit buttons. Then the results are sent to the next page.
But it doesn't seem like you even need to submit this. Just meant to display the textarea.
So, you should be able to just skip the form all together and just have the textarea.

There's a chance this page might not validate because the browser would expect a form, in which case you could just put it in a very basic form tag, like:
<form action="" method="post" onSubmit="return false;">
<textarea> ....... </textarea>
</form>

I'm not sure how many parameters are actually required on the form tag to make it valid, so you might be able to just use <form>, too.

The rest are just making it do nothing:
action="" [send the data to the current page]
method="post" [send via the post method-- or you could use get, but that would put the data as part of the url]
onSubmit="return false;" [when you submit it... don't-- skip submission]

Anyway, you probably don't need the form tag. It certainly isn't needed for functionality, but it *might* not validate. Not sure on the rules there.

cherylsaynhi
10-28-2007, 02:37 AM
Thanks so much for your help! I thought you might like to see how it turned out, so here's the link:

http://www.freewebs.com/cherylsmith/tinytimmyspacelayouts.htm

Now, If I could just figure out an easier way to show a preview of the layouts.:eek: ...lol