Online PHP editor is going to be changed...

We are going to:

  1. Redesign the site
  2. Work with SSH instead of FTP
  3. Switch to HTTPS
  4. Work without "session" to improve security
  5. And, of course, remain open source

Please consider...

  1. Checking our new PHP blog
  2. Visit the new Facebook page


I'm using SSH and I will continue using online-php.com

<? Online-PHP::Tutorials ?>

« Back

  • ZF: Create very basic login form

     

    The class itself, located in 'models' directory, named "LoginForm.php":
     
    	class Application_Form_LoginForm extends Zend_Form {
    
    		public function init() {
    
    			$login = new Zend_Form_Element_Text('login');
    			$login->setLabel('login')->setRequired(true);
    
    			$passw = new Zend_Form_Element_Password('password');
    			$passw->setLabel('password')->setRequired(true);
    
    			$submit = new Zend_Form_Element_Submit('submit');
    			$submit->setLabel('Login');
    
    			$this->setName('login_form')
    				->setMethod('post')
    				->setAction('/auth/login')
    				->addElements(array($login, $passw, $submit));
    
    		}
    
    	}
     
    usage (The controller action):
        public function indexAction()
        {
            // action body
            $this->view->login_form = new Application_Form_LoginForm();
        }
    
    
    usage (The action view):
    <?php echo $this->login_form; ?>