Welcome Guest, Not a member yet? Register   Sign In
Validation problem, maybe server problem
#1

[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 ?
#2

[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!
#3

[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.
#4

[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/
#5

[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
#6

[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 !




Theme © iAndrew 2016 - Forum software by © MyBB