CodeIgniter Forums
Need help in form post - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Need help in form post (/showthread.php?tid=27666)



Need help in form post - El Forum - 02-17-2010

[eluser]Unknown[/eluser]
<form name="frmsearch" action="index.php/search" method="post">
<label>Search</label>
&lt;input type="text" id="keyword" name="keyword" value="&lt;?php echo @$keyword ?&gt;" /&gt;
&lt;input type="submit" name="btnSubmit" class="go" value="" /&gt;
&lt;input type="hidden" name="post" value="true" /&gt;
&lt;/form&gt;

When submitted above .. CI don't retrieve form values. Gives error message
Severity: Notice
Message: Undefined index: keyword

Please help...its really urgent.

Thanks!
Nitin


Need help in form post - El Forum - 02-17-2010

[eluser]johnpeace[/eluser]
This looks like a view...

Does the controller that loads it include data?

// controller code
$data['keyword'] = 'somevalue';
$this->load('form', $data);

CI is complaining that $keyword hasn't been set.


Need help in form post - El Forum - 02-17-2010

[eluser]Unknown[/eluser]
Thanks for reply...

But some how my problem got fixed.
In form tag, I replaced &lt;?php echo site_url();?&gt; by &lt;?php base_url();?&gt; ..
and suddenly I got post values entered in form text field.

Not sure if this is correct or wrong.... Wink