![]() |
Annoying Error - unexpected T_OBJECT_OPERATOR - 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: Annoying Error - unexpected T_OBJECT_OPERATOR (/showthread.php?tid=39316) |
Annoying Error - unexpected T_OBJECT_OPERATOR - El Forum - 03-07-2011 [eluser]SpaceBiscuits[/eluser] Hello, I am currently following a tutorial on youtube, about making a log in page. The problem is, *i think* the tutorial is based in php5 and I only have the php4 installed on my web hosting package. This may not be the problem but after hours of looking online, this is the only conclusion I can come to. The following is the page which handles the log in view.... I have also included a snippet of the validation code the controllers page. Code: <html> And Code: $this->form_validation->set_rules('username', 'Username', 'redirect|trim|max_length[50]|xxx_clean'); The error that I get is:- Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ')' in /home/califo53/public_html/CodeIgniterBlog/system/application/views/login_view.php on line 18 I hope I am posting this in the correct place, any help would be awesome! Thanks Annoying Error - unexpected T_OBJECT_OPERATOR - El Forum - 03-07-2011 [eluser]wh1tel1te[/eluser] The error that PHP gives you tells you to look at line 18 of your view file, specifically: Code: <?php echo form_input(array('id' -> 'username', 'name', -> 'username')): ?> Have a really good look at that line, I can see the error. Hint: it's nothing to do with your PHP version, just syntax error. Annoying Error - unexpected T_OBJECT_OPERATOR - El Forum - 03-07-2011 [eluser]SpaceBiscuits[/eluser] I had another little look, I saw a couple of errors, and I think I have fixed them... But I still get the same error ![]() Code: <li> Annoying Error - unexpected T_OBJECT_OPERATOR - El Forum - 03-07-2011 [eluser]wh1tel1te[/eluser] "->" is invalid syntax for arrays. Use "=>". Code: <?php echo form_input(array('id' => 'username', 'name' => 'username')); ?> Annoying Error - unexpected T_OBJECT_OPERATOR - El Forum - 03-07-2011 [eluser]SpaceBiscuits[/eluser] Thanks you VERY much for that, I have been stuck on the same error for hours, I think I am loosing my mind ![]() Thanks you once again ![]() |