I am trying to let a user change their details via the sessions (the session in use is called 'Username')
I have got the form that produces the users details from the database, but the code that changes the details
is causing me a problem, it produces this error message;
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/new/changedetails1.asp, line 25, column 62
sql="select * from RegisteredUsers where Username=<%=Session("Username"
-------------------------------------------------------------^
I am not sure how to correct this, can anyone help?
Thanks in Advance
I have got the form that produces the users details from the database, but the code that changes the details
is causing me a problem, it produces this error message;
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/new/changedetails1.asp, line 25, column 62
sql="select * from RegisteredUsers where Username=<%=Session("Username"
-------------------------------------------------------------^
I am not sure how to correct this, can anyone help?
Thanks in Advance
Code:
<!--#include file = "clock.inc" -->
<HTML>
<HEAD>
<TITLE>Amend Details</TITLE>
</HEAD>
<BODY>
<div id="content">
<input type="button" onClick="document.all.content.style.zoom=(document.all.content.style.zoom==1?2:1);" value="Change Font Size">
<body onload="StartClock()" onunload="KillClock()">
<form name="theClock" action="changedetails1.asp" METHOD="post">
<input type="text" name="theTime" size=6><% Response.Write Date %>
<H1><U><B>Amend Details</U></B></H1>
<BR>
Title <input type="text" name="txtNewTitle" size="20" value="<%=Session("Title")%>"><br>
First Name <input type="text" name="txtNewFirstName" size="20" value="<%=Session("First Name")%>"><br>
Surname <input type="text" name="txtNewSurname" size="20" value="<%=Session("Surname")%>"><br>
Address 1 <input type="text" name="txtNewAddress1" size="20" value="<%=Session("Address 1")%>"><br>
Address 2 <input type="text" name="txtNewAddress2" size="20" value="<%=Session("Address 2")%>"><br>
Town <input type="text" name="txtNewTown" size="20" value="<%=Session("Town")%>"><br>
County <input type="text" name="txtNewCounty" size="20" value="<%=Session("County")%>"><br>
Post Code <input type="text" name="txtNewPostCode" size="20" value="<%=Session("Post Code")%>"><br>
Email Address <input type="text" name="txtNewEmailAddress" size="20" value="<%=Session("EmailAddress")%>"><br>
Telephone Number <input type="text" name="txtNewTelephoneNo" size="20" value="<%=Session("Telephone Number")%>"><br>
<BR>
<input type="Submit" name="Submit" value="Submit my New Details"><BR>
<input type="Reset" name="Reset" value="Clear">
</div>
</BODY>
</html>
Code:
<!-- #include file="clock.inc" -->
<!-- #include file="ProjectConnection.asp" -->
<!-- METADATA TYPE="typelib"
FILE="c:\Program Files\Common Files\System\ado\msado15.dll" -->
<html>
<head>
<body>
<div id="content">
<input type="button" onClick="document.all.content.style.zoom=(document.all.content.style.zoom==1?2:1);" value="Change Font Size">
<body onload="StartClock()" onunload="KillClock()">
<form name="theClock">
<input type=text name="theTime" size=6><% Response.Write Date %><BR>
<%
Dim objRS, strConnect
Set objRS = Server.CreateObject("ADODB.Recordset")
sql="select * from RegisteredUsers where Username=<%=Session("Username")%>"
objRS.Open sql, strConnect, 3,3
objRS.Fields("Title") = Request.Form("txtNewTitle")
objRS.Fields("First Name") = Request.Form("txtNewFirstName")
objRS.Fields("Surname") = Request.Form("txtNewSurname")
objRS.Fields("Address 1") = Request.Form("txtNewAddress1")
objRS.Fields("Address 2") = Request.Form("txtNewAddress2")
objRS.Fields("Town") = Request.Form("txtNewTown")
objRS.Fields("County") = Request.Form("txtNewCounty")
objRS.Fields("Post Code") = Request.Form("txtNewPostCode")
objRS.Fields("Telephone Number") = Request.Form("txtNewTelephoneNo")
objRS.Fields("EmailAddress") = Request.Form("txtNewEmailAddress")
objRS.Close
Set objRS = Nothing
%>
</div>
</body>
</html>