Zend Framework

Archive for January 17th, 2009

Zend Framework Tutorial- simple signup and login authentication

Posted by Faheem Abbas on January 17, 2009

After writing separate articles on different Zend framework topics, its now time to write a full fledge tutorials. I am starting from a simple sign up and login authentication example and hopefully will discuss some advance topic in future.

So lets get started.

First create a table in your database by executing the following sql query.

CREATE TABLE ‘users’ (

‘id’ int(11) NOT NULL auto_increment,

‘firstname’ varchar(100) default NULL,

‘lastname’ varchar(100) default NULL,

‘email’ varchar(255) NOT NULL,

‘username’ varchar(100) NOT NULL,

‘password’ varchar(15) NULL,

PRIMARY KEY  (‘id’)

)

Next create a model against this table in your application/model/ directory. I am creating Users.php and writing the following code in it.

<?

class Users extends Zend_Db_Table

{

protected $_name=”users”;

}

?>

Now create a controller named AuthController.php in application/controllers/ directory and place the following code in it

<?

class AuthController extends Zend_Controller_Action

{

public function loginAction()

{

}

public function signupAction()

{

}

public function logoutAction()

{

}

public function homeAction()

{

}

}

?>

Sorry this blog is deprecated.

“Read new version of this article here”.http://zendgeek.blogspot.com/2009/07/zend-framework-sign-up-and.html

Posted in Zend Framework Tutorials | 13 Comments »