...

View Full Version : HTML Generator Script?



Snip3Kitty
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 :)

blackrain87
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.

Snip3Kitty
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

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

Example 1: PHP

$url='http://foo.bar/';
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"));
</script>

Hope that helps.:thumbsup:

Snip3Kitty
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:

Lerura
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(){
RoomData=document.getElementById('Room').value
ServerData=document.getElementById('Server').value
String=escape('http://www.somewhere.com/?'+RoomData+','+ServerData);
location.href="makedata.htm?"+String;
}

in makedata.htm:

<script><!--
LS=location.search;
LS=LS.substring(1);
document.write(LS);
//--></script>

Snip3Kitty
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>

Lerura
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:

URL=document.getElementById('UrlInput').Value;
Text=document.getElementById('TextInput').Value;
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:

DivStart='<div>';
DivEnd='</div>';
and then at the end combine them all;

FinalString=DivStart+LinkString+DivEnd;
Your final string will then be:

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum