CodeIgniter Forums
Validation problem, maybe server problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Validation problem, maybe server problem (/thread-1801.html)



Validation problem, maybe server problem - El Forum - 06-27-2007

[eluser]Référencement Google[/eluser]
Hi,

I get a problem with a simple form to validate.
In local it's perfectly working, but once on the prod server, impossible to make it work.

In my view form i have things like:

Code:
<?=$this->validation->prenom_error?>

And once on the production server, i get errors like :

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: prenom_error

Filename: contact_form/contact_form.php

Line Number: 8

Can somebody help me ?


Validation problem, maybe server problem - El Forum - 06-27-2007

[eluser]woopsicle[/eluser]
mm sounds like its complaining cos the validation variable hasnt been set when the form hasnt been posted yet..


Code:
<?=if (isset($this->validation->prenom_error)) : $this->validation->prenom_error; endif;?>

i need to run.. try something like the above.. havent tested it!


Validation problem, maybe server problem - El Forum - 06-27-2007

[eluser]Référencement Google[/eluser]
Yes, i also thought about that, but then I will loose the validation library power!
This is then not a solution, and also it do it also while the form was submited... I think it's maybe something about server configuration, but I don't know what.


Validation problem, maybe server problem - El Forum - 06-27-2007

[eluser]Rick Jolly[/eluser]
Was the error reporting less strict on the development server? Are you using set_fields() on first page load as well as on posting? You could try initializing your validation fields on the first page load since they wouldn't have been populated from the post array.

EDIT: Also see this if you are autoloading the validation library:
http://ellislab.com/forums/viewthread/46687/


Validation problem, maybe server problem - El Forum - 06-30-2007

[eluser]freaksauce[/eluser]
[quote author="Rick Jolly" date="1183024634"]Was the error reporting less strict on the development server? Are you using set_fields() on first page load as well as on posting? You could try initializing your validation fields on the first page load since they wouldn't have been populated from the post array.[/quote]

You've just saved me a lot of head scratching Rick, thanks! I had the set_fields() function in my login/register function but hadn't included it in my login/index! Easy when you know how! Wink


Validation problem, maybe server problem - El Forum - 07-02-2007

[eluser]Référencement Google[/eluser]
[quote author="Rick Jolly" date="1183024634"]
EDIT: Also see this if you are autoloading the validation library:
http://ellislab.com/forums/viewthread/46687/[/quote]

Sorry for my late answer..
Yes Rick, that was it !
I do not understand why, but on my local server (wich is a lot more restrictive regarding post datas than the production server) it is working with autoload, but on the production server it is not, loading the Validation library within the controller class solve the problem.

Thank you !