Ver Mensaje Individual
  #7 (permalink)  
Antiguo 25/11/2003, 16:30
maxiiiiiiiiiiii
 
Fecha de Ingreso: noviembre-2003
Ubicación: maracay
Mensajes: 26
Antigüedad: 21 años, 6 meses
Puntos: 0
este esta es la pagina index.asp


<%
Option Explicit
Dim sql, username, rsUser, rsMessages, newcount

username = Session("username")

'If the username cookie is set, they must have logged in, so get their details from the database
if username <> "" then
%>
<!--#include file="conn.asp"-->
<%
sql = "SELECT icon FROM Users WHERE username = '" & username & "'"
Set rsUser = Server.CreateObject("ADODB.Recordset")
rsUser.Open sql, conn, 3, 3

sql = "SELECT messageread FROM messages WHERE sendto = '" & username & "'"
Set rsMessages = Server.CreateObject("ADODB.Recordset")
rsMessages.Open sql, conn, 3, 3

newcount = 0
if not rsMessages.EOF then
rsMessages.Movefirst
do until rsMessages.EOF
if rsMessages("messageread") = False then
newcount = newcount + 1
end if
rsMessages.Movenext
loop
rsMessages.Movefirst
end if
end if
%>

<html>
<head>

<script language="JavaScript">
<!-- hide on

function popup(popupfile,winheight,winwidth)
{
open(popupfile,"PopupWindow","resizable=no,height= " + winheight + ",width=" + winwidth + ",scrollbars=no");
}

// hide off -->
</script>

<title>Homepage</title>
</head>
<body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000">
<font face="arial,helvetica" size=2>

<h3>Sample Login Site</h3>

<table width="180" cellpadding=3 cellspacing=0 border=1 bordercolor="#000000" align="right">
<%'If they're not logged in, then display a login box
if username = "" then%>
<tr>
<th bgcolor="#000000"><font face="arial,helvetica" size=2 color="#FFFFFF">Sign In <%=Request.Cookies("remember")%></font></th>
</tr>
<tr>
<form name="login" action="signin.asp" method="post">
<input type="hidden" name="page" value="index.asp">
<td align="center" bgcolor="#FFFFFF">
<font face="arial,helvetica" size=1><b>
Username : <input type="text" name="username" size="12" style="font-size: 8pt; font-family: Tahoma, Verdana Arial, Helvetica, sans-serif;" value="<%=Request.Cookies("remember")%>"><br>
Password : <input type="password" name="password" size="12" style="font-size: 8pt; font-family: Arial, Helvetica, sans-serif;"><br>
Remember me : <input type="checkbox" name="stayloggedin" value="yes"<%if Request.Cookies("remember") <> "" then Response.Write("checked") end if%>><br>
<input type="submit" value="Login" style="font-size: 8pt; font-family: Arial, Helvetica, sans-serif;"><br>
<a href="pwd_forget.asp">I forgot my password</a><br>
-<br>
<a href="signupform.asp">sign me up!</a>
</b></font>
</td>
</form>
</tr>
<%'If they are, show a mini profile box plus a sign out link
else%>
<tr>
<th bgcolor="#000000"><font face="arial,helvetica" size=2 color="#FFFFFF">Welcome Back!</font></th>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<font face="arial,helvetica" size=1><b>
<img src="icons/<%=rsUser("icon")%>.gif" width=50 height=50 align="right">
<font size=2>Welcome <%=username%>.</font><br>
<a href="javascript:popup('profile.asp',370,275)">Vie w/Edit Profile</a><br>
<a href="inbox.asp">My Inbox (<%=newcount%> new)</a><br>
<a href="userview.asp">View Userlist</a><br>
<a href="signout.asp">Sign Out</a>
</b></font>
</td>
</tr>
<%
rsUser.close
set rsUser = nothing
rsMessages.close
set rsMessages = nothing
conn.close
set conn = nothing
end if
%>
</table>

<p><b>This is a sample site to show you the pieces of the login and signup application put together.</b></p>

<p>You can <a href="signupform.asp">sign up here</a> or just log in (there's already a username of &quot;<b>webuser</b>&quot; with a password of &quot;<b>philweb</b>&quot; in the database).</p>

<p>Checking the &quot;Remember Me&quot; checkbox now just remembers the username for next visit (the user still has to enter their password). This is down to security issues with cookie faking.</p>

<p>There's also a <a href="membersonly.asp">members only page</a> to give you an example of how to block out non-registered users to certain pages.</p>

<p>The <a href="philogin_admin.asp">Admin Section</a> allows some user management. The readme file contains the password for this (which I advice you to change asap).</p>

<p>There's a new addition in this release of the much-requested <a href="userview.asp">user list</a> and <a href="inbox.asp">inbox</a>, with <a href="messagecompose.asp">message sending facilities</a>. They're pretty self-explanatory, just have a play about with them.</p>

<p>Once logged in, users can use the Profile Editor to alter their stored profile.</p>

</font>
</body>
</html>
__________________
saludos