Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A login form is made at header of cakephp site. Form at header is visible at every page.

PHP
<?php
	echo $this->Form->create('User', array('id' => 'loginform', 'type' => 'post','name'=>'btnLoginHeader','action' =>'login')); ?>
	<table>
	<tr>			    
           <td><?php echo $this->Form->button('Login', array('type'=>'submit', 'class' => 'btnLogin', 'name'=>'btnLoginHeader')); ?></td>
	    <td><?php echo $this->Form->input('username',   array('label'=>false,'name'=>'email','placeholder'=>'Username',          
'required' => 'required')); ?></td>
	     <td><?php echo $this->Form->input('password',   array('label'=>false,'name'=>'password','placeholder'=>'Password','required' => 'required')); ?></td>
	</tr>
	</table>
	<?php echo $this->Form->end(); ?>






In cakephp, form find controller function which is mentioned in 'action' of form, and that action in controller calls the view with the same name as function. My situation is different that I don't need view. And I have set session in login function of controller. How to work with form at header ?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900