try somethng like this
while(money !=0){
//do shopping
}
try somethng like this
while(money !=0){
//do shopping
}
plz clear ur question
u r telling a flow
whats the question?
public function createUser() {
$validate = new Validation($_POST);
$validate->add_rules('firstName','required');
$validate->add_rules('lastName','required');
$validate->add_rules('userName','required');
$validate->add_rules('password','required');
$validate->add_rules('address','required');
$validate->add_rules('email', 'required', 'email');
if(Captcha::valid($_POST['captcha_response']))
{
$valid = $validate->validate();
if ($valid) {
var_dump($valid);
$userData = array(
'first_name' => $_POST['firstName'],
'last_name' => $_POST['lastName'],
'user_email' => $_POST['email'],
'user_password' => $_POST['password'],
'user_address' => $_POST['address'],
'user_name' => $_POST['userName']
);
$this->mUser->create($userData);
$this->vTemplate->set('pageTitle', 'easyAd-admin | Thankyou');
$this->vContent = new View('message');
$this->vContent->set('process', 'signUp');
$this->vTemplate->set('content', $this->vContent->render(FALSE));
$this->vTemplate->render(TRUE);
}
}
else{
$this->captcha = new Captcha;
$this->vTemplate->set('pageTitle', 'easyAd-admin | Signup');
$this->vContent = new View('sign_up');
$this->vContent->set('captcha', $this->captcha);
$this->vContent->set('errors',$validate->errors('form_error_messages'));
$this->vTemplate->set('content', $this->vContent->render(FALSE));
$this->vTemplate->render(TRUE);
}
here i have removed the above error about calling function of a non object but still not getting error messages in the form
as im understading, u r getting the mail like this
<html>
<body>
<p>name:</p>
<p>email:</p>
</body>
</html>
is it so???
Show your validate function. Problem is most likely there.
this is my validate function
private function validate()
{
$validate = new Validation($_POST);
$validate->add_rules('firstName','required');
$validate->add_rules('lastName','required');
$validate->add_rules('userName','required');
$validate->add_rules('password','required');
$validate->add_rules('address','required');
$validate->add_rules('email', 'required', 'email');
if(Captcha::valid($_POST['captcha_response'])){
$valid = $validate->validate();
if($valid){
return $valid;
}
}
}
have you created an object? Perhaps it would help if you posted the relevant code (e.g. line 90 of user.php).
yes
line 90 is line 26 in posted code and i ve created an object in validate() function
i have read kohana documentation and put my query on discussion forum too but still no response
Can you post your code? And you might get more help in the Kohana forum.
the code in which validation is being done
private function validate()
{
$validate = new Validation($_POST);
$validate->add_rules('firstName','required');
$validate->add_rules('lastName','required');
$validate->add_rules('userName','required');
$validate->add_rules('password','required');
$validate->add_rules('address','required');
$validate->add_rules('email', 'required', 'email');
if(Captcha::valid($_POST['captcha_response'])){
$valid = $validate->validate();
if($valid){
return $valid;
}
}
}
the code where i want to generate error messages
public function createUser() {
$validate = $this->validate();
if ($validate) {
$userData = array(
'first_name' => $_POST['firstName'],
'last_name' => $_POST['lastName'],
'user_email' => $_POST['email'],
'user_password' => $_POST['password'],
'user_address' => $_POST['address'],
'user_name' => $_POST['userName']
);
$this->mUser->create($userData);
$this->vTemplate->set('pageTitle', 'easyAd-admin | Thankyou');
$this->vContent = new View('message');
$this->vContent->set('process', 'signUp');
$this->vTemplate->set('content', $this->vContent->render(FALSE));
$this->vTemplate->render(TRUE);
} else {
$this->captcha = new Captcha;
$this->vTemplate->set('pageTitle', 'easyAd-admin | Signup');
$this->vContent = new View('sign_up');
$this->vContent->set('captcha', $this->captcha);
$this->vContent->set('errors',$validate->error('form_error_messages'));
$this->vTemplate->set('content', $this->vContent->render(FALSE));
$this->vTemplate->render(TRUE);
}
}
but in else condition i m getting error
"
Fatal error: Call to a member function error() on a non-object in C:\xampp\htdocs\admin\application\controllers\user.php on line 90"
You forgot to specify with what ? Something you cannot find in the documentation ?
i am totally ne wto kohana. i ve read documentation but could not able to generate error messages on form validation. although validation is working but not able to generate errors :(
i am new to kohana.
any body here to help me out??
:(
hi all
i am new to kohana
i am getting the following error
"Fatal error: Cannot redeclare class Session_Core in C:\xampp\htdocs\admin\system\libraries\Session.php on line 12"
plz help me to correct it
i am in a big trouble
i am new to JIRA
i did not find JIRA category dats y asking question here
how can i deploy JIRA on my server????
i am new to perl, before i ve ben working on php
i want to knw that how i can run myperl script using wamp or how to activate perl in xampp
please if any 1 can help me out
i m creating a new row onclick containing 3 drop downs in it,
if i add 3 rows drop downs are shown but thier names are same, how can i change the name of every drop down in each row so that it can be handled on php page?
any help
i m new to php
is it possible to generate pdf files with php using wamp as a web server
i m suffering with the following error
Warning: oci_connect() [function.oci-connect]: ORA-01017: invalid username/password; logon denied in C:\wamp\www\New Folder\connection.php on line 4
but i've tried atleast 100 times, username and passwords both r correct
$conn=oci_connect("sysdba", "hammad90", "");
is thr any problem in the above code?
is it necessary to install any other s/w like apache etc if i have WAMP or XAMP on my machine to connect php with oracle?