Hi,

Does anyone have a better idea of the ajax based login code, the one that does error checking etc, and also the member registration authentication. so far i have got an idea of the following!!!

function doLoginAction() {
	$filter = new Zend_Filter_Input($_POST);
	if (!($login = $filter->testAlnum('login'))) {
		echo "Login field should contains only alphanumeric characters.\n";
	} else if (!($password = $filter->testAlnum('password'))) {
		echo "Password field should contains only alphanumeric characters.\n";
	} else if (!('joe' == $login && 'secret' == $password)) {
		echo 'Wrong login/password.';
	} else {
		echo 'url:/Login/Success/';

If you have better ones i will really appreciate

you realise this will be visible in the source?

why not make use of some kinda backend, even if it is just a simply php script.

Hi,

Does anyone have a better idea of the ajax based login code, the one that does error checking etc, and also the member registration authentication. so far i have got an idea of the following!!!

function doLoginAction() {
    $filter = new Zend_Filter_Input($_POST);
    if (!($login = $filter->testAlnum('login'))) {
        echo "Login field should contains only alphanumeric characters.\n";
    } else if (!($password = $filter->testAlnum('password'))) {
        echo "Password field should contains only alphanumeric characters.\n";
    } else if (!('joe' == $login && 'secret' == $password)) {
        echo 'Wrong login/password.';
    } else {
        echo 'url:/Login/Success/';

If you have better ones i will really appreciate

The code you posted is PHP not javascript. Where is the AJAX?

Edited 3 Years Ago by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.