CodeIgniter Forums
Error in field form_hidden - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Error in field form_hidden (/thread-22154.html)



Error in field form_hidden - El Forum - 08-31-2009

[eluser]Unknown[/eluser]
Form_hidden box is where I want to put an IP

Code:
<?php echo form_hidden('ip_address', $REMOTE_ADDR);?>

and is an error:

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: REMOTE_ADDR
Filename: views/form.php
Line Number: 19


What am I doing wrong?


Error in field form_hidden - El Forum - 08-31-2009

[eluser]Dam1an[/eluser]
Probably not defined the variable. Can you show the code in the controller where you create the variable, and pass of to your view?