<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Styles/CssStyles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<td class="HeadingWithBackGround"><center>
Login Maintenance
</center></td>
<tr>
<td> </td>
</tr>
<tr>
<td align="center" class="Heading">To register 'Click' create Login</td>
</tr>
</table>
<table width="30%" align="center" cellpadding="="1" cellspacing="0" >
<tr>
<td width="25%" align="center"><b>User Name</b></td>
<td width="40%"><input type="text" name="txtName" ></td>
<tr>
<td width="25%" align="center"><b>Password</b></td>
<td width="40%%"><input type="Password" name="txtpass"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align ="Left"><input type=Submit name=btnOk value=" Create "
class=Buttons>
<input type=Reset name=btnCancel value=" Clear " class=Buttons></td>
</tr>
</table>
</body>
</html>
We have a few problems here. First, one should state the question in
the first part of the post, and then include code.
><%
> dim Conn, mysql
> Set Conn= Server.CreateObject("Adodb.Connection")
> Conn.open="Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=D:\MDN2008\asp\db1.mdb;Persist Security Info=False"
> 'mysql= "insert into UserInfo(U_Name,P_Word)values('"&
> Request.Form("uname") & "', '"& Request.Form("passw") &"')"
> 'Conn.execute (mysql)
No need to include commented out code here. The commented code is not
causing the problem.
> Set Rs =Server.CreateObject("Adodb.Recordset")
No need to open a record set for an insert statement.
> Conn.BeginTrans
> mysql= "insert into UserInfo([Name],PWord)values(' " &
> Request.Form("txtName") & "', '" & Request.Form("txtpass") & "' )"
You are seriously opening yourself to SQL injection. You need to
validate all user input server side _before_ it goes into the db.
> response.write(mysql)
And so what does mysql say? It would probably be more helpful to quote
this than commented out code.
> Conn.CommitTrans
> conn.close
> %>
>
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
New pages should use a strict doctype, transitional is for pages that
are, well, in transition.
><html>
><head>
><title>Login</title>
><meta http-equiv="Content-Type" content="text/html;
>charset=iso-8859-1"> <link href="Styles/CssStyles.css" rel="stylesheet"
>type="text/css"> </head>
><body>
>
> <table width="100%" border="0" cellspacing="0" cellpadding="1">
> <td class="HeadingWithBackGround"><center>
> Login Maintenance
> </center></td>
> <tr>
> <td> </td>
> </tr>
> <tr>
> <td align="center" class="Heading">To register 'Click' create
> Login</td> </tr>
> </table>
Please stop abusing tables and deprecated elements. This could simply
be marked up as:
<h1>Login Maintenance</h1>
<form method="post" action="page.asp">
<fieldset><legend>Fill out the form</legend>
>
> <table width="30%" align="center" cellpadding="="1" cellspacing="0" >
> <tr>
> <td width="25%" align="center"><b>User Name</b></td>
> <td width="40%"><input type="text" name="txtName" ></td>
> <tr>
> <td width="25%" align="center"><b>Password</b></td>
> <td width="40%%"><input type="Password" name="txtpass"></td>
> </tr>
> <tr>
Yikes! Another table, but no form element whatsoever. How do you
expect anything to get to the server without the form element?
> <td> </td>
> <td> </td>
> </tr>
> <tr>
> <td> </td>
What's this? This is just bloat.
> <td align ="Left"><input type=Submit name=btnOk value=" Create
> "
> class=Buttons>
> <input type=Reset name=btnCancel value=" Clear "
> class=Buttons></td>
It will help you to be consistent in quoting element attributes. If you
ever decide to go with XHTML, attributes _must_ be quoted.
> </tr>
> </table>
> </body>
> </html>
>
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Perhaps the fields aren't posting because the login page does not have
a <form> tag and </form> end tag.
Best regards,
-Paul
www.Bullschmidt.com - Freelance Web and Database Developer
www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips