 |
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4  | This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040 |
Please indicate which version of the book you are using when posting questions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 31st, 2004, 03:29 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Using the Referrer - Beginning DW- MX - Page 357
Hi Imar!
Just when I thought everything is going all right, I have faced another problem.
In Using The Referrer (page 357) after I made the changes to login.asp, the page has stopped functioning properly.
As instructed on page 359, when I go to the popularFirstPage I am directed to login.asp as expected. There I give wrong user name and password and I am again correctly taken to the login page with the red error message. Fine up to now.
Now when I give *correct* user name and password â I get âHTTP 404 - File not foundâ error message.
After adding the code, even if I go directly to login page, and give correct user name and password â I still get the file not found message.
When I removed the extra code from this âtry it outâ section, everything started working properly again. But as soon as I make the changes it stops working.
Could it be ME + PWS again?
Shubhada.
|
|

March 31st, 2004, 03:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Can you post the code for the Login page?
I doubt this has something to do with PWS, but since our last problem, I am not too sure of that anymore.... ;)
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

March 31st, 2004, 04:05 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here is the code for login.asp:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim sErrorMessage
Dim sReferrer
If Request.Form("txtReferrer") = "" Then
sReferrer = Request.QueryString("accessdenied")
Else
sReferrer = Request.Form("txtReferrer")
End If
If sReferrer = "" Then
sReferrer = "admin/admin.asp"
End If
If Request.Form("txtUserName") <> "" And _
Request.Form("txtPassword") <> "" Then
If Request.Form("txtUserName") = "UserName" And _
Request.Form("txtPassword") = "Password" Then
Session("MM_Username") = Request.Form("txtUserName")
Response.Redirect("sReferrer")
Else
sErrorMessage = "<span class=""clsErrorMessage""><br>" & _
"Login failed. Please type a valid username and password. </span>"
End If
End If
%>
<html>
<head>
<title>Login to GlobalSoccerEvents.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<link href="styles/mainStyles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/logo.gif"></td>
<td><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><a href="home.asp" id="home">Home</a></td>
<td> </td>
<td><a href="events.asp" id="events">Events</a></td>
<td> </td>
<td><a href="mysite.asp" id="mysite">My Site</a></td>
<td> </td>
<td><a href="login.asp" id="login">Login</a></td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<Script language="JavaScript" type="text/javascript">
var sPageName = '<%=Request.ServerVariables("SCRIPT_NAME")%>';
sPagename = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowerCase();
sPageName = sPageName.substr(0,sPageName.lastIndexOf('.'));
if (document.getElementById(sPageName))
{
document.getElementById(sPageName).style.fontWeigh t = 'Bold';
document.getElementById(sPageName).style.fontSize = '14pt';
}
</Script><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h2>Login to GlobalSoccerEvents.com</h2></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="8">
<tr>
<td>Please type your Username and Password,
then click the Login button. <%= sErrorMessage %></td>
</tr>
<tr>
<td width="100%" bgcolor="#CCCCCC" colspan="2">
sReferrer = <%= sReferrer %>
<form action="login.asp" method="post" name="frmLogin" onSubmit="MM_validateForm('txtUserName','','R','tx tPassword','','R');return document.MM_returnValue">
<p>Username<br>
<input name="txtUserName" type="text" class="clsTextInput" id="txtUserName" style="width:150 px">
</p>
<p>Password<br>
<input name="txtPassword" type="password" class="clsTextInput" id="txtPassword" style="width:150 px">
</p>
<p>
<input name="btnLogin" type="submit" id="btnLogin" value="Login">
</p>
<input name="txtReferrer" type="hidden" value="<%=sReferrer%>">
</form>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center"><br>
<br>
<br>
<br>
<br>
</td>
</tr>
</table>
</body>
</html>
----- Shubhada.
|
|

March 31st, 2004, 04:10 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Right. See this:
Code:
If Request.Form("txtUserName") = "UserName" And _
Request.Form("txtPassword") = "Password" Then
Session("MM_Username") = Request.Form("txtUserName")
Response.Redirect("sReferrer")
Else
sErrorMessage = "<span class=""clsErrorMessage""><br>" & _
"Login failed. Please type a valid username and password. </span>"
End If
You are redirecting to the string "sReferrer", not to the value of the variable sReferrer. Change it to this:
Response.Redirect(sReferrer)
Is this in the book, or did you make a type?
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

March 31st, 2004, 04:31 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No...!!!!!! The quote marks are not in the book - I made a very silly typo!!!
Now everything is working fine!
Thanks.
Shubhada.
|
|

March 31st, 2004, 04:53 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Ha, great.
I am trying to reproduce your initial problem on PWS under Windows ME in a Virtual PC, but it's not working yet.... Glad this problem had nothing to do with PWS......
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

March 31st, 2004, 05:00 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had a lot of problems even installing PWS on ME - as PWS is not supposed to be for ME. But After using a patch by Microsoft I could at least install it properly. But it seems there are many issues with ME+PWS apart from installation. I might have to face them as I progress through your book.
yeah..glad this problem had nothing to do with PWS......
Shubhada.
|
|

March 31st, 2004, 05:07 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yeah, it's quite a messy installation procedure, isn't it? Using an install package not really meant for PWS, installing fixes, installing just parts of the package etc etc, all that just to end up with a Web server not capable of running Web sites really well. Then again, it may work well for learning and development purposes....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

March 31st, 2004, 08:13 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Actually once before I had installed it without the Microsoft patch and in one part. During installation it showed a message "MTS not installed" and after installation it said "Installation not complete". Still it worked to a large extent. For basic educational purpose even that half-installation' was ok! But may be I didn't require Transaction Server then..
Shubhada.
|
|
 |