Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/modules/conditional-login-box.inc.php
<% 
	include_once( "$modules/utils.inc.php" );
	if( $tok && $tok == md5( getPasswdForUser( $u )) ) {
		$qs = "SELECT count(*) FROM links WHERE submitter='$u'";
		$con = mysql_connect();
		mysql_selectdb( getDBName() );
		$q = mysql_query( $qs );
		if( $q )
			$numLinks = mysql_result($q, 0);

%>
<b>Welcome back, <%= $u %>!</b> &nbsp;You have <a href="/index"><%= $numLinks %> links</a>.
(Not <%= $u %>? <a href="/logout">Logout</a>)
<%
	} else {
%>
<form action="/login" method="post">
	Login: <input class="field" name="userId" value="<%= $u %>" size="12" maxlength="24" />
	Password: <input class="field" type="password" name="password" size="12" maxlength="24" />
	&nbsp; <input class="button" type="submit" value="Login" />
	<input type="hidden" name="op" value="login" />
	<br />
	<br />
	<div class="center"><a href="/misc/forgot-password">Forgot your password</a>?</div>
</form>
<% } %>
Return current item: FeedMeLinks, Social BookmarkingSince2002