查看: 758|回复: 3
|
关于LOGIN的问题
[复制链接]
|
|
我正在写个HTML网站,想把某个部分的网页给保护起来,希望通过LOGIN PAGE才能通过看到。
比如我CLICK "PRODUCT",就会出现LOGIN PAGE,写入了LOGIN NAME和PASSWORD才会到"PRODUCT" PAGE。
可是小弟非常不懂DATABASE,希望有人可以教教~
对于DATABASE,还真的完全不懂怎样写CODE在HTML上~~
希望各位大大帮忙,万二分感激。 |
|
|
|
|
|
|
|
发表于 21-3-2007 09:36 AM
|
显示全部楼层
你需要用到 server side scripting, 例如 asp/php/jsp/asp.net... 可以去找找关于这些 scripting 和 session 的资料. |
|
|
|
|
|
|
|
楼主 |
发表于 21-3-2007 09:42 AM
|
显示全部楼层
原帖由 goatstudio 于 21-3-2007 09:36 AM 发表
你需要用到 server side scripting, 例如 asp/php/jsp/asp.net... 可以去找找关于这些 scripting 和 session 的资料.
我看过人家的网站是用ASP写的。。。。但看不懂也不知道如何着手~
DATABASE该怎么弄? |
|
|
|
|
|
|
|
楼主 |
发表于 21-3-2007 11:56 AM
|
显示全部楼层
写了一些。。。。可是就是走不到。。。救命~
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My company</title>
</head>
<body>
<body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<p> </p>
<p> </p>
<p align="center">Login Page</p>
<form name="login" method="post">
<p align="center"> LoginID :
<input type="text" name="username" class="button">
</p>
<p align="center">Passwords :
<input type="password" name="password" class="button">
</p>
<p align="center">
<input type="submit" name="Submit" value=" Login ">
<input type="reset" name="Submit2" value=" Reset" class="bet">
</p>
</form>
<script language="vbscript">
dim <script language="vbscript">
sub check()
dim user,pwd,conn,rs
<%
Response.Flush
If Request("password")<>"" And Request("username")<>"" Then
username_tmp=Request("username")
password_tmp=Request("password")
Set conn=Server.CreateObject("Adodb.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("ltkdb.mdb")
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.Open "Select * From user Where username='"& username_tmp &"'",conn,0,1
If Not(Rs.Eof) Then
If username_tmp=Rs("username") And password_tmp=Rs("password") Then
Response.Write "<script language=javascript>location.href='success.html'</script>"
End If
Else
Response.Write "<script language=javascript>location.href='error.html'</script>"
End If
End If
%>
为什么一直跳进LOGIN.ASP的?
出错在那里? |
|
|
|
|
|
|
| |
本周最热论坛帖子
|