Can I change the background of the blog?
Please advise why the following code only giving empty string no u
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > Please advise why the following code only giving empty string no u 16 September 2008 04:02:53

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Please advise why the following code only giving empty string no u

Mmkg 16 September 2008 04:02:53
 <%
dim Conn, mysql
Set Conn= Server.CreateObject­("Adodb.Connection")­
Conn.open="Provider­=Microsoft.Jet.OLEDB­.4.0;Data
Source=D:\MDN2008\a­sp\db1.mdb;Persist Security Info=False"
'mysql= "insert into UserInfo(U_Name,P_W­ord)values('"& Request.Form("uname­")
& "', '"& Request.Form("passw­") &"')"
'Conn.execute (mysql)
Set Rs =Server.CreateObjec­t("Adodb.Recordset")­
Conn.BeginTrans
mysql= "insert into UserInfo([Name],PWord)val­ues(' " &
Request.Form("txtNa­me") & "', '" & Request.Form("txtpa­ss") & "' )"
response.write(mysq­l)
Conn.CommitTrans
conn.close
%>


<!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/CssSty­les.css" rel="stylesheet" type="text/css">
</head>
<body>

<table width="100%" border="0" cellspacing="0" cellpadding="1">
<td class="HeadingWithB­ackGround"><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>U­ser Name</b></td>
<td width="40%"><input type="text" name="txtName" ></td>
<tr>
<td width="25%" align="center"><b>P­assword</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>
Add comment
Adrienne Boswell 17 August 2008 19:31:01 permanent link ]
 Gazing into my crystal ball I observed =?Utf-8?B?TU1LRw==?­=
<MMKG@discussions.m­icrosoft.com> writing in
news:6943211A-B451-­4C46-8493-30C52F0DF5­DA@microsoft.com:

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\a­sp\db1.mdb;Persist Security Info=False"
'mysql= "insert into UserInfo(U_Name,P_W­ord)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.CreateObjec­t("Adodb.Recordset")­

No need to open a record set for an insert statement.

Conn.BeginTrans
mysql= "insert into UserInfo([Name],PWord)val­ues(' " &
Request.Form("txtNa­me") & "', '" & Request.Form("txtpa­ss") & "' )"

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(mysq­l)

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</titl­e>
<meta http-equiv="Content­-Type" content="text/html;­
charset=iso-8859-1­"> <link href="Styles/CssSty­les.css" rel="stylesheet"
type="text/css"> </head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<td class="HeadingWithB­ackGround"><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>F­ill out the form</legend>

<table width="30%" align="center" cellpadding="="1" cellspacing="0" >
<tr>
<td width="25%" align="center"><b>U­ser Name</b></td>
<td width="40%"><input type="text" name="txtName" ></td>
<tr>
<td width="25%" align="center"><b>P­assword</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.cavalcad­e-of-coding.info
Please respond to the group so others can share

Add comment
Guest 16 September 2008 04:02:53 permanent link ]
 On Aug 17, 7:20am, MMKG <M...@discussions.m­icrosoft.com> wrote:
<%
dim Conn, mysql
Set Conn= Server.CreateObject­("Adodb.Connection")­
Conn.open="Provider­=Microsoft.Jet.OLEDB­.4.0;Data
Source=D:\MDN2008\a­sp\db1.mdb;Persist Security Info=False"
'mysql= "insert into UserInfo(U_Name,P_W­ord)values('"& Request.Form("uname­")
& "', '"& Request.Form("passw­") &"')"
'Conn.execute (mysql)
Set Rs =Server.CreateObjec­t("Adodb.Recordset")­
Conn.BeginTrans
mysql= "insert into UserInfo([Name],PWord)val­ues(' " &
Request.Form("txtNa­me") & "', '" & Request.Form("txtpa­ss") & "' )"
response.write(mysq­l)
Conn.CommitTrans
conn.close
%>
<!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/CssSty­les.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<td class="HeadingWithB­ackGround"><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>U­ser Name</b></td>
<td width="40%"><input type="text" name="txtName" ></td>
<tr>
<td width="25%" align="center"><b>P­assword</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>

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
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > Please advise why the following code only giving empty string no u 16 September 2008 04:02:53

see also:
How to get the current project path?
Creating new Modes
looking for advice on fixing issue…
пройди тесты:
see also:
it's my brother and my band
Harvest your surprise on Thanksgiving…
How to convert protected and…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .