when a user registers with our page, I’d like a page to come up once a user clicks submit that it would say ‘thank you for registering, please check your email.’.
here is my code for the add function
function add(){
$this->set('title_for_layout', 'Please Login');
$this->set('stylesheet_used', 'style');
$this->set('image_used', 'eBOXLogo.jpg');
if($this->request->is('post')){
$this->User->create();
if ($this->User->save($this->request->data))
{
$this->Session->setFlash('The user has been saved');
}
else { $this->Session->setFlash('The user could not be saved. Please, try again.'); }
}
}
here is my add view
<h2>Please enter your details</h2>
<?php
echo $this->Form->create('User', array('action'=>'add'));
echo $this->Form->input('username',array('label'=>'Username: '));
echo $this->Form->input('password',array('label'=>'Password: '));
echo $this->Form->input('password_confirmation',array('type'=>'password'));
echo $this->Form->input('email',array('label'=>'Email: '));
echo $this->Form->input('title',array('label'=>'Title: '));
echo $this->Form->input('firstname',array('label'=>'First Name: '));
echo $this->Form->input('surname',array('label'=>'Surname: '));
echo $this->Form->input('street',array('label'=>'Street Address: '));
echo $this->Form->input('city',array('label'=>'City: '));
echo $this->Form->input('state',array('label'=>'State: '));
echo $this->Form->input('country',array('label'=>'Country: '));
echo $this->Form->end('Click here to Register ');
?>
or:
In other words, just create another action that you redirect to, or simply render a special view when the user has registered.