Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTML Generator Script?

    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

  • #2
    New Coder
    Join Date
    Jun 2010
    Posts
    71
    Thanks
    14
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New Coder
    Join Date
    Jan 2010
    Location
    The Netherlands
    Posts
    53
    Thanks
    10
    Thanked 0 Times in 0 Posts
    You can do this using an other language:

    Example 1: PHP
    PHP Code:
    $url='http://foo.bar/';
    echo 
    "<a href='".$url.">Link to website</a> 
    Example 2: Javascript
    Code:
    <script type="text/javascript">
    var str="Link to foo";
    document.write(str.replace("foo", "bar"));
    </script>
    Hope that helps.

  • #5
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    881
    Thanks
    0
    Thanked 115 Times in 114 Posts
    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>

  • #7
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>
    Last edited by Snip3Kitty; 09-01-2010 at 07:09 AM.

  • #8
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    881
    Thanks
    0
    Thanked 115 Times in 114 Posts
    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
    Code:
    <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:
    Code:
    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:
    Code:
    DivStart='<div>';
    DivEnd='</div>';
    and then at the end combine them all;
    Code:
    FinalString=DivStart+LinkString+DivEnd;
    Your final string will then be:
    Code:
    <div><a href="URL">Text</a></div>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •