View Full Version : HTML Generator Script?

08-28-2010, 04:37 PM
Hi there can anyone help me with a HTML generator that can be used to generate a piece of HTML that people can add to there page for a ChatSpace client.

If Someone could help me on this i would be most grateful :)

08-28-2010, 06:16 PM
Where is the code coming from? Is it default code that would be the same for everybody, or are there variables in the code that need to be different? If it is a unique code, than, PHP is where you would need to look first.

Explain a bit more and I will be happy to help you out.

08-29-2010, 11:34 PM
It is a default code that will be given but there will be slight changes such as the change in the server and room section of the code these are the only variables

08-30-2010, 02:01 PM
You can do this using an other language:

Example 1: PHP

echo "<a href='".$url.">Link to website</a>

Example 2: Javascript

<script type="text/javascript">
var str="Link to foo";
document.write(str.replace("foo", "bar"));

Hope that helps.:thumbsup:

08-30-2010, 04:50 PM
That does not help at all. if you was to read what i posted properly you would see that i want a script that will basically be a form that once the user submits the details ( being room name and server) it will then direct them to a page that will have the HTML shown for them to copy and paste to there website to add the chatspace client. :mad:

08-31-2010, 12:58 AM
if the script has to provide them with a link, based on the submitted data you can use something like this:

<input id="Room">
<input id="Server">
<input type="button" value="Continue" onclick="MakeData();"

function MakeData(){

in makedata.htm:


09-01-2010, 07:00 AM
:mad: i have said it does not give them a link. it gives them a set of HTML code which they can use on their own website.

i will give an example of the Code that will be generated for the user:
<applet code="com.chatspace.v3.Chat" codebase="http://irc.Example.com:8000/Java/" archive="http://irc.example.com:8000/Java/cfs40320.jar" name="cs" width="520" height="500"> <param name="room" value="test"> <param name="rooms" value="true"> <param name="user" value="irchighway.net"> <param name="fullname" value="exampley.net"> <param name="fontsize" value="12"> <param name="copyPaste" value="true"> <param name="tabbedp2p" value="true"> <param name="inputprompt" value="false"> <param name="allowtour" value="true"> <param name="style" value="bold"> <param name="tourprompt" value="true"> <param name="multiplerooms" value="true"> <param name="useUnicode" value="true"> <param name="backimage" value="http://www.mysite.com/randomimage.gif"> <param name="background" value="000066"> <param name="skinspath" value="images\dbs\"> <param name="resource" value=" "> </applet>

09-01-2010, 11:13 PM
You will need to generate a string that contains the permanent data along with the inputdata.

I will use the build-up of a link as example.

a basic link is
<a href="http://hereyougoto/">Click here</a>where the red is the permanent data and the blue is the input data.

to create the link based on where to you want the link to go, and what text you want to represent the link, you can do this:

Lets say that the Url and text is defined by <input>s id'ed "UrlInput" and "TextInput"

Then this is the way:

LinkString='<a href="'+URL+'">'+Text+'</a>';

other tags are without input data.

If you e.g want to put the data inside a basic div. then you must define the opening and closing tag respectively:

and then at the end combine them all;

Your final string will then be:

<div><a href="URL">Text</a></div>