Guest_imported
New member
- Jan 1, 1970
- 0
Hi, i am now doing a project on displaying user data whenever they log into the website. I must be enable to display all the members' resume on the website. i have 2 ASP pages. One is called try1.asp and the other is called time.asp. And i have the following code:
'try1.asp
<%
Dim DataConn, RsPerson, SQL
Dim SQLstr
Set DataConn = Server.CreateObject("ADODB.Connection"
'change your server name to replace omega and name of database to replace 2K04
DataConn.ConnectionString="driver={sql server};server=CON7; database=user;DSN=localserver;PWD=;UID=sa;"
DataConn.Open
SQL = "select * from info where UserID = '" & Request("text1"
& "' and Password='" & Request("password1"
& "'"
%>
<%
if (Request("submit"
<> ""
then
'SQLstr="select NameID from info UserID= " & request("text1"
& "' and password = '" & request("password1"
& "'"
Set RsPerson = DataConn.Execute(SQL)
if not RsPerson.eof then
'name= Request.Form ("SQLstr"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Response.Redirect ("time1.asp"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Else%>
<script>
window.alert ("Invalid records"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
</script>
<%end if%>
<%end if
%>
And i am able to login. But when come to the 2nd page:
time.asp
<%
Dim h, name
Dim DataConn, ConnString
Dim objRs
SQL= "select * from info where UserID = '" & Request("text1"
& "' and Password='" & Request("password1"
& "'"
h = hour(now())
response.write "<html><head><body bgcolor='#000000' text='#ffff00'><center>"
Response.Write "<font face='verdana' size='+2'><p>"
response.write("<p>" & now())
response.write(" (Singapore Time) </p>"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Session.SessionID (NameID)
If h < 12 then
Response.Write ("<p>"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
response.write("Good Morning!" &
response.write("<p>You have logged in!</p>"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Response.Write ("</p><p>"
else
Response.Write ("<p>"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
response.write("Good Afternoon!" & Response.Write objRs("NameID"
)
response.write("<p>You have logged in!</p>"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Response.Write ("</p><p>"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
End if
i am unable to extract the info from the database to display onto the net. So what must be the SQL statement be in order to exract the info from the databse in the 2nd ASP page.
ThankYOu!!
'try1.asp
<%
Dim DataConn, RsPerson, SQL
Dim SQLstr
Set DataConn = Server.CreateObject("ADODB.Connection"
DataConn.ConnectionString="driver={sql server};server=CON7; database=user;DSN=localserver;PWD=;UID=sa;"
DataConn.Open
SQL = "select * from info where UserID = '" & Request("text1"
%>
<%
if (Request("submit"
'SQLstr="select NameID from info UserID= " & request("text1"
Set RsPerson = DataConn.Execute(SQL)
if not RsPerson.eof then
'name= Request.Form ("SQLstr"
Response.Redirect ("time1.asp"
Else%>
<script>
window.alert ("Invalid records"
</script>
<%end if%>
<%end if
%>
And i am able to login. But when come to the 2nd page:
time.asp
<%
Dim h, name
Dim DataConn, ConnString
Dim objRs
SQL= "select * from info where UserID = '" & Request("text1"
h = hour(now())
response.write "<html><head><body bgcolor='#000000' text='#ffff00'><center>"
Response.Write "<font face='verdana' size='+2'><p>"
response.write("<p>" & now())
response.write(" (Singapore Time) </p>"
Session.SessionID (NameID)
If h < 12 then
Response.Write ("<p>"
response.write("Good Morning!" &
response.write("<p>You have logged in!</p>"
Response.Write ("</p><p>"
else
Response.Write ("<p>"
response.write("Good Afternoon!" & Response.Write objRs("NameID"
response.write("<p>You have logged in!</p>"
Response.Write ("</p><p>"
End if
i am unable to extract the info from the database to display onto the net. So what must be the SQL statement be in order to exract the info from the databse in the 2nd ASP page.
ThankYOu!!