Note that there are some explanatory texts on larger screens.

plurals
  1. POadding new user in cakephp
    primarykey
    data
    text
    <p>I am user Cakephp 2.3.8 I am get the problem to register new user my function in <code>Userscontroller.php</code> is</p> <pre><code>function registration() { if (!empty($this-&gt;request-&gt;data)) { if ($this-&gt;request-&gt;data['User']['password'] === $this-&gt;request-&gt;data['User']['confirmPassword']) { // echo "dfgf"; die; $this-&gt;request-&gt;data['User']['status'] = 1; $myPassword = $this-&gt;request-&gt;data['User']['password']; $this-&gt;request-&gt;data['User']['password'] = Security::hash($myPassword, null, true); $repassword = $this-&gt;request-&gt;data['User']['confirmPassword']; $this-&gt;request-&gt;data['User']['confirmPassword'] = Security::hash($repassword, null, true); } else { } if ($this-&gt;User-&gt;save($this-&gt;request-&gt;data)) { $this-&gt;redirect('/'); } else { } } } </code></pre> <p>when I save this value not save in table my model is </p> <pre><code>class User extends AppModel { public $validate = array( 'username' =&gt; array( 'alphaNumeric' =&gt; array( 'rule' =&gt; 'alphaNumeric', 'required' =&gt; true, 'message' =&gt; 'Alphabets and numbers only' ), 'isUnique' =&gt; array( 'rule' =&gt; 'isUnique', 'on' =&gt; 'create', // here 'last' =&gt; false, 'message' =&gt; 'user name allready exist please choose another one' ) ), 'emailId' =&gt; array( 'email' =&gt; array( 'rule' =&gt; 'email', 'required' =&gt; true, 'message' =&gt; 'please enter an valid email' ), 'isUnique' =&gt; array( 'rule' =&gt; 'isUnique', 'on' =&gt; 'create', // here 'last' =&gt; false, 'message' =&gt; 'email allready exist please choose another one' ) ), 'password' =&gt; array( 'match' =&gt; array( 'rule' =&gt; array('match', 'confirmPassword'), 'message' =&gt; 'Passwords doesnt match', ), ), ); /** * match for form validation * * @ * @return ture or flase */ public function match($check, $with) { // Getting the keys of the parent field foreach ($check as $k =&gt; $v) { $$k = $v; } // Removing blank fields $check = trim($$k); $with = trim($this-&gt;data[$this-&gt;name][$with]); // If both arent empty we compare and return true or false if (!empty($check) &amp;&amp; !empty($with)) { return $check == $with; } // Return false, some fields is empty return false; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload