在html中如何实现将本网页中文本框中的值传递到另一个网页的用户名密码框中,并实现登陆

在html网页中,一个按钮,两个文本框,在<SCRIPT language=JavaScript> /SCRIPT>当中如何写代码能够实现将这两个文本框中的值传递到另一个制定地址的网页中的用户名和密码处,并实现登陆,说的越详细越好,谢谢了

页面必须是跳转过去的才行。例如另一个页面是page.html那么你跳转的时候 page.html?username=tony&password=123 跳转到这个地址,
然后到另一个页面的时候在脚本里面写
<SCRIPT language=JavaScript>
var url = window.location.href;
然后var username = url.split("?")[1].split("&")[0].split("=")[1] //这样就获取到用户名了。
var password = url.split("&")[1].split("=")[1];
然后把值赋给你的密码文本框
document.getElementById("txtpassword").value = password;
document.getElementById("txtusername").value=username;
< /SCRIPT>
然后验证用户名和密码就可以了。
不懂再问!这东西你的需求比较特殊,估计没有源码,没人这样做登录的追问

页面跳转的时候,在第一个页面中如何写代码将username和password传到另一个页面中?比如另一个页面的地址是http:\\17.15.18.2,另外在另一个页面中有个type为submit的按钮,怎么样在传值完成后让这个按钮直接执行?谢谢

温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-09-15
这是提交按钮后的事件程序 是VB的
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As SqlConnection = New SqlConnection("server=localhost;uid=sa ;pwd=******;database=******")
conn.Open()
Dim dr As SqlDataReader = Nothing

Dim cmd As SqlCommand = New SqlCommand("select username,password from dlmmm where username='" + TextBox1.Text + "'and password='" + TextBox2.Text + "'", conn)
dr = cmd.ExecuteReader()
If Not dr.Read() Then
Response.Write("密码名错误") '这里也可以转向另一个网页
cmd.Cancel()
dr.Close()
conn.Close()
conn.Dispose()
Response.End()
Else
Response.Write("正确") '这里也可以转向另会员网页
cmd.Cancel()
dr.Close()
conn.Close()
conn.Dispose()
Response.End()

End If
第2个回答  2011-09-15
页面跳转过去的时候可以把这两个值传过去,然后在第二个页面里面进行设置登录,用php比较好
第3个回答  2011-09-15
页面跳转过去的时候可以把这两个值传过去,然后在第二个页面里面进行设置登录
第4个回答  2012-07-13
楼主,这个技术现在实现了吗??我也想知道啊。。