HTML Code on a Free (.wordpress.com) Website

  • Unknown's avatar

    Is it possible to add code to <head>?
    Me and my friends found a way to have a special Login, which would take special users, with his/her own special (NOT WordPress Connected) Login + Password.
    Me and the Website Owner, think that it would be useful to have for our Classified Operations.
    Some of the code has to go into the <head> area of the code, so I ask again;
    Is it possible to add code to the <head> area?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    If you want to see the code, I can copy it here.

    <html>
    <head>
    <script type=”text/javascript”>
    function login() {
    if(event.keyCode == 13) {
    validate();
    }
    }

    </script>
    <script type = “text/javascript”>
    var count = 4;
    function validate() {
    var un = document.myform.username.value;
    var pw = document.myform.pword.value;
    var valid = false;

    var unArray = [“admin” <!–Username–>]; // as many as you like – no comma after final entry
    var pwArray = [“admin” <!–Password–>]; // the corresponding passwords;
    for (var i=0; i <unArray.length; i++) {
    if ((un == unArray[i]) && (pw == pwArray[i])) {
    valid = true;
    break;
    }
    }

    if (valid) {
    alert (“Login was successful”);
    window.location = “http://www.google.com”;
    return false;
    }

    var t = ” tries”;
    if (count == 1) {t = ” try”}

    if (count >= 1) {
    alert (“Invalid username and/or password. You have ” + count + t + ” left.”);
    document.myform.username.value = “”;
    document.myform.pword.value = “”;
    setTimeout(“document.myform.username.focus()”, 25);
    setTimeout(“document.myform.username.select()”, 25);
    count –;
    }

    else {
    alert (“Still incorrect! You have no more tries left!”);
    document.myform.username.value = “No more tries allowed!”;
    document.myform.pword.value = “”;
    document.myform.username.disabled = true;
    document.myform.pword.disabled = true;
    return false;
    }

    }

    </script>
    </head>
    <body onkeyup=”login();”>
    <form name = “myform”>
    <p>Username<input type=”text” name=”username”></p><p>Password<input type=”password” name=”pword”></p>
    <p><input type=”button” value=”Check In” name=”Submit” onclick= “validate()”>
    </p>

    </form>

    The Body Part, I can do myself, it’s just the Head Part that’s really annoying.
    -OfficialGeneralX

  • Unknown's avatar

    you can not edit code on a WordPress.COM blog – security and reliability issues

  • Unknown's avatar

    Thanks auxclass, do you know any other way I could put a Login Area?
    -OfficialGeneralX

  • Unknown's avatar

    You would need to get your own host and have a WordPress.ORG install of the software –

    you can set a blog to Private but then if someone wants to view a blog they need to be invited into the blog – the general public can’t see it at all

  • Unknown's avatar
  • The topic ‘HTML Code on a Free (.wordpress.com) Website’ is closed to new replies.