• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help in form post

#1
[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

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

#3
[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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.