<%@ Language = "VBScript" %>
<%
Option Explicit
Dim conn
Dim Connect
Dim rstLogin
Dim strUsername, strPassword
Dim strSQL
%>
<html>
<head><title>Login Page</title>
</head>
<body>
<%
If Request.Form("action") <> "validate_login" Then
%>
<form action="test.asp" method="post">
<input type="hidden" name="action" value="validate_login" />
<table border="0">
<tr>
<td align="right">Login:</td>
<td><input type="text" name="login" /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td align="right"></TD>
<td><input type="submit" VALUE="Login" /></td>
</tr>
</table>
</form>
<%
Else
set conn = createobject("ADODB.Connection")
conn.open = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=**this is an ip address;"_
& "DATABASE=*******;"_
& "UID=giffarmadillo;PWD=******;"
strSQL = "SELECT * FROM tbluser " _
& "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _
& "AND password='" & Replace(Request.Form("password"), "'", "''") & "';"
Set rstLogin = conn.Execute(strSQL)
If Not rstLogin.EOF Then
%>
<p>
<strong>Welcome to the administrative section <%=Request.form("Login")%></strong>
</p>
<p>
In this section you will be able to dynamically program the site content and dramatically change the functionality of your website.
<br>
<br>
Below you will fin a list of the current data that is shown on your pages, to edit this data simply click the edit button next to the section you wish to edit.
<br>
<br>
If you have any problems using this area or any other queries then please contact me on
<form name="form2" method="post" action="">
<table width="701" height="213" border="1">
<tr>
<td><div align="center"><strong>Section Title </strong></div></td>
<td><div align="center"><strong>Current Data </strong></div></td>
<td><div align="center"><strong>Last updated </strong></div></td>
<td><div align="center"><strong>Edit?</strong></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<p>
<insert address>
<%
Else
%>
<p>
<p>
<font size="4" face="arial,helvetica"><strong>
Login Failed - Please verify username and password.
</strong></font>
</p>
<p>
<a href="login.asp">Retry</a>
</p>
<%
'Response.End
End If
' Clean Up
rstLogin.Close
Set rstLogin = Nothing
cnnLogin.Close
Set cnnLogin = Nothing
End If
%>