ASP commands produce no results in browser 
Author Message
 ASP commands produce no results in browser

Is there any way of checking why ASP
commands such as response.write and
request.form are not being written to
the browser screen, with IE5,

As an example

InputForm.htm

<html>
<head><title>Login Page</title></head>
<body>
<FORM ACTION = "logon2.asp" METHOD = "post">
  Username: <input type="text" name="username">
  Password: <input type="text" name="password">
<input type="hidden" name="isSubmitted" value="yes">
<input type="submit" value="Login">
</form>
</body>
</html>

logon2.asp

<HTML>
<BODY>

<%

response.write(request.form("Username"))
response.write(request.form("Password"))

</BODY>
</HTML>
%>

this coding seems to produce a blank screen.
Have also been having simular problems
that occur intermittently with other ASP
commands, whose output does not appear on the
browser screen, is there any way of
debugging this,

Regards
Marco Orlandi
KZNTL - Corporate IT
South Africa



Mon, 22 Dec 2003 17:14:17 GMT  
 ASP commands produce no results in browser
<%

response.write(request.form("Username"))
response.write(request.form("Password"))

</BODY>
</HTML>
%>

this is not valid.
You cant place plain HTML inside the ASP script tag.

'try this:
=====

<HTML>
<BODY>
<%
response.write(request.form("Username"))
response.write(request.form("Password"))
%>
</BODY>
</HTML>
==========

greets, Jim



Quote:
> Is there any way of checking why ASP
> commands such as response.write and
> request.form are not being written to
> the browser screen, with IE5,

> As an example

> InputForm.htm

> <html>
> <head><title>Login Page</title></head>
> <body>
> <FORM ACTION = "logon2.asp" METHOD = "post">
>   Username: <input type="text" name="username">
>   Password: <input type="text" name="password">
> <input type="hidden" name="isSubmitted" value="yes">
> <input type="submit" value="Login">
> </form>
> </body>
> </html>

> logon2.asp

> <HTML>
> <BODY>

> <%

> response.write(request.form("Username"))
> response.write(request.form("Password"))

> </BODY>
> </HTML>
> %>

> this coding seems to produce a blank screen.
> Have also been having simular problems
> that occur intermittently with other ASP
> commands, whose output does not appear on the
> browser screen, is there any way of
> debugging this,

> Regards
> Marco Orlandi
> KZNTL - Corporate IT
> South Africa



Mon, 22 Dec 2003 18:44:08 GMT  
 ASP commands produce no results in browser

Quote:
>-----Original Message-----
><%

>response.write(request.form("Username"))
>response.write(request.form("Password"))

></BODY>
></HTML>
>%>

>this is not valid.
>You cant place plain HTML inside the ASP script tag.

>'try this:
>=====

><HTML>
><BODY>
><%
>response.write(request.form("Username"))
>response.write(request.form("Password"))
>%>
></BODY>
></HTML>
>==========

>greets, Jim

many thanks, this seems to function, would you be able to
advise whether there are any obvious errors in the
code that follows, as the screen remains blank
when an incorrect Username /Password is selected

InputForm.htm

<html>
<head><title>Login Page</title></head>
<body>
<FORM ACTION = "logon2.asp" METHOD = "post">
  Username: <input type="text" name="username">
  Password: <input type="text" name="password">
<input type="hidden" name="isSubmitted" value="yes">
<input type="submit" value="Login">
</form>
</body>
</html>

logon2.asp

<HTML>
<BODY>

<%
Dim UserName
Dim Password

UserName = Request.Form("Username")
Password = Request.Form("Password")

Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "FILEDSN=c:\dsn\Developers.dsn"

If Len(UserName) > 0 Then
msql = ("SELECT Username, Password FROM Delphi WHERE
Username='" & UserName & "' AND
Password='" & Password & "'")
Set RS = MyConn.Execute(msql)

 If RS.EOF Then
  Response.write("Invalid Username Or Password")
 End If

  RS.Close
  Set RS = Nothing
  Set MyConn = Nothing

End If
%>

</BODY>
</HTML>

Regards
Marco Orlandi
KZNTL Corp IT, SA



Mon, 22 Dec 2003 23:10:19 GMT  
 ASP commands produce no results in browser

Quote:
> UserName = Request.Form("Username")
> Password = Request.Form("Password")

UserName = Replace(Request.Form("Username"),"'","''")
Password = Replace(Request.Form("Password"),"'","''")

Quote:
> Set RS = MyConn.Execute(msql)

In PerlScript if $conn->execute() has any kind of errors it doesn't return a
RecordSet. This may be happening with VBScript. RS may still be a variant
and EOF may be a property on it. I'd do something like this:

objRs.Open msql, objConn, , , 1 ' adCmdText = 1

if objRs.EOF and objRs.BOF then
 response.write "invalid username or password"
end if



Tue, 23 Dec 2003 05:16:40 GMT  
 ASP commands produce no results in browser
many thanks, with the following code it seems to be giving
an error "Unterminated string constant"

msql = "SELECT Username, Password FROM Delphi WHERE
Username='" & UserName & "' <--------------- here

is there a reason why this is occuring, noticed some folks
concat strings in a diff way i.e.

msql = msql & .... etc , is this necessary ,


<HTML>
<BODY>
<%
Dim UserName
Dim Password

UserName = Replace(Request.Form("Username"),"'","''")
Password = Replace(Request.Form("Password"),"'","''")

Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "FILEDSN=c:\dsn\Developers.dsn"
Set RS = Server.CreateObject("ADODB.Recordset")

If Len(UserName) > 0 Then
msql = "SELECT Username, Password FROM Delphi WHERE
Username='" & UserName & "'
        AND Password='" & Password & "'"

RS.Open msql, MyConn , , , 1 ' adCmdText = 1

 If RS.EOF and RS.BOF then
  response.write("Invalid Username Or Password")
  Else
  response.write("Succesful Login")

  RS.Close
  Set RS = Nothing
  Set MyConn = Nothing
 End If
End If
%>

</BODY>
</HTML>

Regards
Marco Orlandi
KZNTL -Corporate IT



Tue, 23 Dec 2003 14:30:35 GMT  
 ASP commands produce no results in browser
Many thanks the output is now appearing on the
browser screen, this code seems to solve the
"unterminated string error"

msql = "SELECT Username, Password FROM Delphi WHERE
Username='" & UserName & "'"
msql =  msql & " AND Password='" & Password & "'"

Regards
Marco Orlandi
KZNTL - gov.za



Tue, 23 Dec 2003 15:16:50 GMT  
 ASP commands produce no results in browser
And now the results are not appearing any more
on the browser, wow i wonder what this could be,
any suggestions, come on folks,

Regards
Marco Orlandi
KZNTL - Corporate IT

Quote:
>-----Original Message-----
>Many thanks the output is now appearing on the
>browser screen, this code seems to solve the
>"unterminated string error"

>msql = "SELECT Username, Password FROM Delphi WHERE
>Username='" & UserName & "'"
>msql =      msql & " AND Password='" & Password & "'"

>Regards
>Marco Orlandi
>KZNTL - gov.za
>.



Tue, 23 Dec 2003 18:32:00 GMT  
 ASP commands produce no results in browser

Quote:
> msql = "SELECT Username, Password FROM Delphi WHERE
> Username='" & UserName & "'

msql = "SELECT Username, Password FROM Delphi WHERE Username='" & Username &
"'"

This should work.
Notice the SQL statement starting with a double quote ( " ) thismeans that
you are starting to define the contents of a stringvariable (msql in thi
case)

In your version you forgot to close the string with a double qoute ( " )

greets, Jim


Quote:
> many thanks, with the following code it seems to be giving
> an error "Unterminated string constant"

> msql = "SELECT Username, Password FROM Delphi WHERE
> Username='" & UserName & "' <--------------- here

> is there a reason why this is occuring, noticed some folks
> concat strings in a diff way i.e.

> msql = msql & .... etc , is this necessary ,


> <HTML>
> <BODY>
> <%
> Dim UserName
> Dim Password

> UserName = Replace(Request.Form("Username"),"'","''")
> Password = Replace(Request.Form("Password"),"'","''")

> Set MyConn = Server.CreateObject("ADODB.Connection")
> MyConn.Open "FILEDSN=c:\dsn\Developers.dsn"
> Set RS = Server.CreateObject("ADODB.Recordset")

> If Len(UserName) > 0 Then
> msql = "SELECT Username, Password FROM Delphi WHERE
> Username='" & UserName & "'
> AND Password='" & Password & "'"

> RS.Open msql, MyConn , , , 1 ' adCmdText = 1

>  If RS.EOF and RS.BOF then
>   response.write("Invalid Username Or Password")
>   Else
>   response.write("Succesful Login")

>   RS.Close
>   Set RS = Nothing
>   Set MyConn = Nothing
>  End If
> End If
> %>

> </BODY>
> </HTML>

> Regards
> Marco Orlandi
> KZNTL -Corporate IT



Fri, 26 Dec 2003 14:36:43 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Piping results of command line call to file from ASP

2. Piping results of command line call to file from ASP

3. Using Scripting.Shell Exec command to capture the results of a SFTP ls command

4. Automating Mail Merge with VB.Net and Office XP and Office 2000 produces mixed results

5. oracle 8 not producing desired results

6. Adding tables to Report in Crystal Reports 6 produces unexpected results

7. Crystal reports produces different result in VB than in CR developer

8. Stored procedure doesn't produce results

9. SHGetFileInfo, producing unexpected results...

10. SHGetFileInfo, producing unexpected results...

11. capture data from comm port producing erratic results

12. Help! Kill the ICON Produced by Shell Command

 

 
Powered by phpBB® Forum Software