Include code to have your own login page

For whatever reason you need your custom login page other than the default one, here is some code:



(please note of my really bad naming scheme of variables, it not really made for public eyes)



This is NOT finished code for public.


<br />
<?<br />
define('AREA', 'C');<br />
define('AREA_NAME' ,'customer');<br />
require dirname(__FILE__) . '/prepare.php';<br />
require dirname(__FILE__) . '/init.php'; <br />
<br />
$error=array();<br />
foreach($_SESSION['notifications'] as $n=>$v){<br />
	if($v['title']=='Error'){<br />
		$error[]=$v['message'];<br />
		unset($_SESSION['notifications'][$n]);<br />
	}<br />
}<br />
<br />
?><br />
<span style="color:red"><? echo implode('<br>',$error); ?></span><br><br />
<form action="/index.php" method="post" name="main_login_form"><br />
<input type="hidden" name="form_name" value="main_login_form"><br />
<input type="hidden" name="return_url" value="/"><br />
<input type="hidden" name="remember_me" value="Y"><br />
<input type="hidden" name="dispatch[auth.login]" value="Sign+in"><br />
<input type="text" name="user_login"><br />
<input type="password" name="password"><br />
<input type="submit"><br />
</form><br />

```<br />
<br />
While it is possible to use only HTML, problem there is that a bad login gets recorded into a session and when you finally login you start get error messages that should not be there anymore, therefore, you must use PHP and handle the session errors as they arrive, show them, clean them so they would not disturb peace again.

[quote name=‘TexasGuy’]For whatever reason you need your custom login page other than the default one, here is some code:



(please note of my really bad naming scheme of variables, it not really made for public eyes)



This is NOT finished code for public.



```php

define('AREA', 'C');
define('AREA_NAME' ,'customer');
require dirname(__FILE__) . '/prepare.php';
require dirname(__FILE__) . '/init.php';

$error=array();
foreach($_SESSION['notifications'] as $n=>$v){
if($v['title']=='Error'){
$error[]=$v['message'];
unset($_SESSION['notifications'][$n]);
}
}

?>

',$error); ?>










```

While it is possible to use only HTML, problem there is that a bad login gets recorded into a session and when you finally login you start get error messages that should not be there anymore, therefore, you must use PHP and handle the session errors as they arrive, show them, clean them so they would not disturb peace again.[/QUOTE]


I have a use for this, did you ever end up finishing it up and cleaning it up?