Welcome Guest, Not a member yet? Register   Sign In
Problems with PHP 5.3? (Warning: noob inside)
#1

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

[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');
#3

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




Theme © iAndrew 2016 - Forum software by © MyBB