...

View Full Version : Auto sign in without having to click on link? (VERY NEW to THIS)



tnflyguy81
06-29-2010, 09:42 PM
I really don't know what I am doing, but I need to know how to alter this script to load this website without having to click "Weathersentry online". I would like to double click on the icon the code is attached to and it sign in automatically. Can anyone help?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Sample Signin link WeatherSentry Online</title>
</head>

<body>

<form id="DTNSigninForm" action="http://weather.dtn.com/dtnweather/common/signin.do" style="margin: 0,0,0,0;" >
<a onclick='document.getElementById("DTNSigninForm").submit();return false;' href="javascript:void(0);">WeatherSentry Online</a>
<input type="hidden" name="username" value="username" />
<input type="hidden" name="password" value="password" />
<input type="hidden" name="autoLogin" value="true" />
</form>

</body>
</html>

Dormilich
06-29-2010, 10:37 PM
<form id="DTNSigninForm" action="http://weather.dtn.com/dtnweather/common/signin.do" style="margin: 0,0,0,0;" >
<input type="hidden" name="username" value="username" />
<input type="hidden" name="password" value="password" />
<input type="hidden" name="autoLogin" value="true" />
</form>
<script type="application/javascript">
document.getElementById("DTNSigninForm").submit()
</script>

tomws
06-29-2010, 10:40 PM
I wonder if the onload event could handle that?


<body onload="document.getElementById("DTNSigninForm").submit();return false;">

Or slop it up by dropping a script tag with the submit at the end, maybe.

<script type= text/javascript>
document.getElementById("DTNSigninForm").submit();
</script>
</body>

Old Pedant
06-30-2010, 01:33 AM
I'll bet it doesn't work, though.

I'll bet that the weather.dtn.com site won't allow a <form> to be submitted from outside its domain. That's a very very fundamental security measure in most frameworks and the ".do" extension there says it's using one of the standard JSP frameworks, I think.

So this code would only work if it was actually on a page on that same domain's site.

Wanna bet?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum