redlorry920
05-03-2004, 07:51 PM
I currently have a .php file which receives two variables uname/pass from a link. What I want is for the user to be automatically logged on to their hosting account once this window appears.
Currently the username/password populates the user/pass text boxes and the operator presses the submit button to login. I want to bypass this so that the user does not ahve press the button. i.e. when the window loads, they are logged straight in.
Hope this makes sense, I am new to JavaScript! Here's the code:
<HTML><HEAD><TITLE>Extra Services</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<link href="../index_files/main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 16px}
-->
</style>
<script type="text/javascript">
function set_target() {
var username, password;
username = document.forms.login_form.user.value;
password = document.forms.login_form.pass.value;
document.forms.login_form.action = 'https://' + '64.91.230.245' + ':2083' + '/login';
}
</script>
</HEAD>
<BODY>
<form name="login_form" method="post" onsubmit="set_target();">
<table align="center">
<tr>
<td>
<span class="login_text">Username:</span>
</td>
<td>
<input name="user" class="input" type="text" value="<?php
print $uname;
?>" style="width:125;height:18" />
</td>
</tr>
<tr>
<td>
<span class="login_text">Password:</span>
</td>
<td>
<input name="pass" class="input" type="password" value="<?php
print $pass;
?>" style="width:125;height:18" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input class="input" type="submit" value="Login" style="width:200;height:18" onmouseout="blur(this);" />
</td>
</tr>
</table>
</form>
</BODY>
Currently the username/password populates the user/pass text boxes and the operator presses the submit button to login. I want to bypass this so that the user does not ahve press the button. i.e. when the window loads, they are logged straight in.
Hope this makes sense, I am new to JavaScript! Here's the code:
<HTML><HEAD><TITLE>Extra Services</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<link href="../index_files/main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 16px}
-->
</style>
<script type="text/javascript">
function set_target() {
var username, password;
username = document.forms.login_form.user.value;
password = document.forms.login_form.pass.value;
document.forms.login_form.action = 'https://' + '64.91.230.245' + ':2083' + '/login';
}
</script>
</HEAD>
<BODY>
<form name="login_form" method="post" onsubmit="set_target();">
<table align="center">
<tr>
<td>
<span class="login_text">Username:</span>
</td>
<td>
<input name="user" class="input" type="text" value="<?php
print $uname;
?>" style="width:125;height:18" />
</td>
</tr>
<tr>
<td>
<span class="login_text">Password:</span>
</td>
<td>
<input name="pass" class="input" type="password" value="<?php
print $pass;
?>" style="width:125;height:18" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input class="input" type="submit" value="Login" style="width:200;height:18" onmouseout="blur(this);" />
</td>
</tr>
</table>
</form>
</BODY>