<?php
/*
* Created on 14.04.2007
*
* Code © Matthias Reuter (http://pc-intern.com)
*
* @package straightCMS (http://straightvisions.com)
* @author Matthias Reuter (http://pc-intern.com)
* @support: [url="http://projects.pc-intern.com"]http://projects.pc-intern.com[/url] - Support-Forum
*
* It would be nice to get a backlink to [url="http://ipbwi.com"]http://ipbwi.com[/url] to honor the work of the authors
*
* Released under the GNU Lesser General Public License
* [url="http://www.gnu.org/licenses/lgpl.html"]http://www.gnu.org/licenses/lgpl.html[/url]
*
*/
require_once('ipbsdk_class.inc.php');
$SDK =& new IPBSDK();
$page_title = 'Member Login';
require_once('lib/php/includes.inc.php');
if(isset($_POST) && $_POST['action'] == 'login') {
if(empty($_POST['username'])) $system_info .= '<p>You have to type an username.</p>';
elseif(empty($_POST['password'])) $system_info .= '<p>You have to type a password.</p>';
else {
if($SDK->login($_POST['username'],$_POST['password'],$_POST['setcookie'],$_POST['anonlogin'])) header('location: member_login.php').die();
else $system_info .= $SDK->sdk_error();
}
}
echo $header;
// Error Output
if(isset($system_info) && $system_info != '') { echo '<div class="info"><div class="i_system">'.$system_info.'</div></div>'; }
?>
<h2>Login-Form</h2>
<p><?php echo $systemstatus; ?></p>
<?php if($SDK->is_loggedin()) { ?>
<p>Your are already logged in</p>
<?php } else { ?>
<form action="member_login.php" method="post">
<table>
<tr>
<td>
<table>
<tr><td>username</td><td><input style="width:200px;" type="text" name="username" /></td></tr>
<tr><td>password</td><td><input style="width:200px;" type="password" name="password" /></td></tr>
</table>
</td><td>
<table>
<tr><td>remember login</td><td><input type="checkbox" name="setcookie" value="1" checked="checked" /></td></tr>
<tr><td>anonymous login</td><td><input type="checkbox" name="anonlogin" value="1" /></td></tr>
</table>
</td>
</tr>
<tr><td colspan="2"><input type="submit" name="login" value="Login" /></td></tr>
</table>
<input type="hidden" name="action" value="login" />
</form>
<?php } ?>
<h2>Function References</h2>
<p>The following important functions were used for this example:</p>
<ul>
<li><a href="http://projects.pc-intern.com/index.php?showtopic=5714">login</a></li>
</ul>
<?php echo $footer; ?>
Edited by pistonsfreak, 09 February 2008 - 01:31 PM.
