[Solved] - Problem in loading Validation Library |
[eluser]Prasanna[/eluser]
Hi all, I have presented my code below which causes error on my server. But i have tested the same code in some other server, it works fine. So may i know what causes error in the server. Do i needs to check any php.ini settings ? Code: <?php Output: Code: A PHP Error was encountered Can any one guide me on how to fix this issue. Please help me.
[eluser]Shahgeb[/eluser]
load library fo validation in constructor not in index function
[eluser]Prasanna[/eluser]
If i load the validation library in the constructor then it's working fine. But i needs to know why it has to be loaded in the constructor as i does not need the validation library in all the functions of the sample class. The same problem occurs while loading some models. Also we have completed project in the way i have given. So any please provide any alternative solution for the problem.
[eluser]Shahgeb[/eluser]
for this purpose you have load library in that paricular function than it will work. reason have mentioned in user guide in codeignitor. fine hope you got
[eluser]xwero[/eluser]
What is line 33? I just tried your code but without the fields part and it worked.
[eluser]Shahgeb[/eluser]
for loading modle you are facing same problem. try to solve it yourself
[eluser]janogarcia[/eluser]
Prasanna, check your system/logs directory, maybe the validation library is being loaded automatically by another library that you specified in autoload.php ie: Session class with sess_encrypt_cookie set to TRUE (This led me once to a bug when the user was idle for a time longer than sess_expiration) Look for this line in your logs Code: Validation Class Initialized If that's your case, check which library is loading it and under which circumstances.
[eluser]Prasanna[/eluser]
I have updated my post as the line number i have specified is wrong. Now it's perfect.
[eluser]xwero[/eluser]
Couldn't you just add a comment this line is the problem ![]() Code: print_r($this->lang->language);
[eluser]Prasanna[/eluser]
For me this solution got worked Use the following line in the .htaccess file. php_flag zend.ze1_compatibility_mode off For more info have a look @ this http://ellislab.com/forums/viewthread/52308/P15/#450647 |
Welcome Guest, Not a member yet? Register Sign In |