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

Recommended Answers

All 2 Replies

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.