Date Error when Emailing with Code Igniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Date Error when Emailing with Code Igniter (/showthread.php?tid=37328) |
Date Error when Emailing with Code Igniter - El Forum - 01-05-2011 [eluser]eldrinofsoalim[/eluser] Hi guys, I'm really new to Code Igniter. Hopefully I can get help from you guys. I'm getting this error when I try to submit an e-mail. I followed Day 3 of Jeffrey Way's tutorial, but it seems I get this error and he doesn't. Quote:A PHP Error was encountered And... Quote:A PHP Error was encountered I've seen forums where people say the answer is to fix the php.ini file, but I'm really unfamiliar with a few terms so far. Considering that I'm somewhat new, can you guys help point me step-by-step how to fix this? Thanks! eldrinofsoalim Date Error when Emailing with Code Igniter - El Forum - 01-05-2011 [eluser]portgaz[/eluser] You can use the codeigniter date helper or set the Code: date_default_timezone_set("Asia/Manila"); Date Error when Emailing with Code Igniter - El Forum - 01-05-2011 [eluser]chonlatee[/eluser] sorry my English. what your server localhost or real host ? if you can't find other solution you can use this date_default_timezone_set('your time zone'); in you function or Constructors function. Date Error when Emailing with Code Igniter - El Forum - 01-05-2011 [eluser]lennierb5[/eluser] You can view the supported time zones here: http://php.net/manual/en/timezones.php Use the values found there in date_default_timezone_set or if you have access to edit your php.ini file your entry would be something like: date.timezone = "US/Central" Date Error when Emailing with Code Igniter - El Forum - 01-05-2011 [eluser]eldrinofsoalim[/eluser] Thanks for the quick replies! I added the Code: date_default_timezone_set("Asia/Manila"); Then I placed it in the __construct function and it worked, errors don't show anymore. I'm still a bit confused with the difference between index and __constructor. Aren't they both instantiated when the controller is called? Date Error when Emailing with Code Igniter - El Forum - 01-05-2011 [eluser]portgaz[/eluser] When the controller is called/load the __constructor will be first instantiated. I guess the Quote:date()function that you are using isn't on the index function. That's why it throws an error when you included the Code: date_default_timezone_set("Asia/Manila"); Am I wrong? Hopes that helps! Date Error when Emailing with Code Igniter - El Forum - 01-05-2011 [eluser]eldrinofsoalim[/eluser] Here is the code: Code: <?php As you can see, the... Code: date_default_timezone_set("Asia/Manila"); What's the difference between index() function and the __construct() function if both are just instantiated when called? Thanks for the help! |