CodeIgniter Forums
Problems with PHP 5.3? (Warning: noob inside) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Problems with PHP 5.3? (Warning: noob inside) (/showthread.php?tid=26591)



Problems with PHP 5.3? (Warning: noob inside) - El Forum - 01-18-2010

[eluser]Been Told[/eluser]
I am running the latest SVN checked out version of CodeIgniter on my local installation of XAMPP 1.7.2 which comes with PHP 5.3.

I am getting (among other errors) this error message when working through day 3 of Jeffery Way's video tutorials.
Code:
A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant trim - assumed 'trim'

Filename: controllers/email.php

Line Number: 17

The code in question (lines 14-18) is:
Code:
$this->load->library('form_validation');

// field name, error message, validation rules
$this->form_validation->set_rules('name', 'Name', trim|required);
$this->form_validation->set_rules('email', 'Email Address', trim|required|valid_email);
I get similar error messages for line 18, for each of the other parameters (required, valid_email).

Do I have an error im my code or is that a compatibility problem with PHP 5.3?
Any help/hints/tips would be greatly appreciated. If I didn't provide enough info, please tell me.

I've had more errors about deprecated this and that, but that went away when I got the latest version of CI via SVN.


Problems with PHP 5.3? (Warning: noob inside) - El Forum - 01-18-2010

[eluser]flaky[/eluser]
change to
Code:
$this->form_validation->set_rules('name', 'Name', 'trim|required');
$this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email');



Problems with PHP 5.3? (Warning: noob inside) - El Forum - 01-18-2010

[eluser]Been Told[/eluser]
D'oh! Thanks flaky. Smile