Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Problem

Status
Not open for further replies.

noellees1

Programmer
Feb 2, 2004
383
GB
Hi,
If i enter an ASP page through windows explorer it opens up in IE with all the code visible, however if i open the file thrugh dreamweaver using the preview in browser command it opens the page perfectly and it shows the login dialouge etc.
WHY!!!!
Does the script only not show when i go through dreamweaver? It seems stupid! Dreamweaver wanted to be the controller of ASP files what was the standard because is et it back to IE.
I want the asps to open properly when i click them have i screwed up the file associations?

I uploaded the file here
I see this
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/loginconn.asp" -->
<%
// *** Validate request to log in to this site.
var MM_LoginAction = Request.ServerVariables("URL");
if (Request.QueryString!="") MM_LoginAction += "?" + Server.HTMLEncode(Request.QueryString);
var MM_valUsername=String(Request.Form("User"));
if (MM_valUsername != "undefined") {
var MM_fldUserAuthorization="";
var MM_redirectLoginSuccess="sucess.asp";
var MM_redirectLoginFailed="fail.asp";
var MM_flag="ADODB.Recordset";
var MM_rsUser = Server.CreateObject(MM_flag);
MM_rsUser.ActiveConnection = MM_loginconn_STRING;
MM_rsUser.Source = "SELECT User, Password";
if (MM_fldUserAuthorization != "") MM_rsUser.Source += "," + MM_fldUserAuthorization;
MM_rsUser.Source += " FROM userpass WHERE User='" + MM_valUsername.replace(/'/g, "''") + "' AND Password='" + String(Request.Form("Password")).replace(/'/g, "''") + "'";
MM_rsUser.CursorType = 0;
MM_rsUser.CursorLocation = 2;
MM_rsUser.LockType = 3;
MM_rsUser.Open();
if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
// username and password match - this is a valid user
Session("MM_Username") = MM_valUsername;
if (MM_fldUserAuthorization != "") {
Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
} else {
Session("MM_UserAuthorization") = "";
}
if (String(Request.QueryString("accessdenied")) != "undefined" && false) {
MM_redirectLoginSuccess = Request.QueryString("accessdenied");
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginSuccess);
}
MM_rsUser.Close();
Response.Redirect(MM_redirectLoginFailed);
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="POST" action="<%=MM_LoginAction%>">
<p>Username
<input name="User" type="text" id="User">
</p>
<p>Password
<input name="Password" type="password" id="Password">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>

Instead of the log in form i made
Please help!
 
Are you opening the page via a local IIS server or just doing File>Open in Explorer?

The page must be "served" to the browser for the asp to work.

Dreamweaver will show you the page layout and the locations of asp segments in the code.
As far as I know it won't run any asp script and display the result though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top