/    Sign up×
Community /Pin to ProfileBookmark

using a form to log into a domain control panel

Hey, i am trying to use a form to log into a domain control panel. cpanel. but something is up with my code, and I have no idea where the problem is. can anyone tell me what they think might be the problem? basicly the user put’s in their username, password and domain name, once they hit submit it pulls the login function and supposed to redirect the url to their panel but it just refreshes the screen and nothing happens.

heres what I got…

[list]

  • <form name=”log1″>
    <SCRIPT LANGUAGE=”JavaScript”>
    function Login() {
    var username = log1.username.value;
    var password = log1.password.value;
    var server = log1.domain1.value;
    if (username && password && server) {
    var dsite = “https://” + username + “:” + password + “@” + server + “:2083”;
    document.location = dsite;
    }
    else {
    alert(“Please enter your username, password, and FTP server’s address.”);
    }
    }
    // End –>
    </script>

    <input type=”text” name=”username” size=”20″ value=”username”><font size=”2″>

    </font><b><font face=”Verdana” size=”1″ color=”#666666″><br>
    <input type=”password” name=”password” size=”20″ value=”123456″> &nbsp;<br>
    <input type=”text” name=”domain1″ size=”20″ value=”domain.com”> &nbsp;<br>
    <br>
    <input border=”0″ src=”bullet.jpg” name=”I1″ width=”62″ height=”11″ type=”image” onClick=”Login();return=false”></font>

    </form>


  • [/list]

    to post a comment
    JavaScript

    7 Comments(s)

    Copy linkTweet thisAlerts:
    @JupacSep 27.2003 — try document.log1.blah.value;
    Copy linkTweet thisAlerts:
    @savagegerbilauthorSep 27.2003 — no, that didnt do it either. aw pooty. this thing has been giving me fits for the past 2 days. I know it's something really simple I just cant figure it out
    Copy linkTweet thisAlerts:
    @JupacSep 27.2003 — <SCRIPT LANGUAGE="JavaScript">

    function Login() {

    var username = document.log1.username.value;

    var password = document.log1.password.value;

    var server = document.log1.domain1.value;

    if (username && password && server) {

    var dsite = "https://" + username + ":" + password + "@" + server + ":2083";

    document.location.href = dsite;

    }

    else {

    alert("Please enter your username, password, and FTP server's address.");

    }

    }

    // End -->

    </script>



    <form name="log1">

    <input type="text" name="username" size="20" value="username"><font size="2">

    </font><b><font face="Verdana" size="1" color="#666666"><br>

    <input type="password" name="password" size="20" value="123456"> <br>

    <input type="text" name="domain1" size="20" value="domain.com"> <br>

    <br>

    <input type="button" onClick="Login();"></font>


    </form>

    i no y u put <form>then<script>
    Copy linkTweet thisAlerts:
    @savagegerbilauthorSep 27.2003 — ya,

    put <form> <script> code</script> form code</form>
    Copy linkTweet thisAlerts:
    @JupacSep 27.2003 — the code i posted works
    Copy linkTweet thisAlerts:
    @savagegerbilauthorSep 27.2003 — oh sorry, I misunderstood what you meant. I guess being up for 25 hrs straight makes me stupid like that ?

    Awesome, it works! and now I know what was causing the problem, the stupid image I was using for the form submit button
    Copy linkTweet thisAlerts:
    @JupacSep 27.2003 — happy to help
    ×

    Success!

    Help @savagegerbil spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...