Php 控制器未在codeigniter中获取输入值
我有一个输入字段Php 控制器未在codeigniter中获取输入值,php,codeigniter,post,controller,codeigniter-2,Php,Codeigniter,Post,Controller,Codeigniter 2,我有一个输入字段 <?php echo form_open('moneyexchange/borrow_first_page'); ?> <input id ="Amount" type="text" placeholder="Amount in €" name="writtenamount"> <a type="submit" href="<?php echo base_url();? >index
<?php
echo form_open('moneyexchange/borrow_first_page'); ?>
<input id ="Amount" type="text" placeholder="Amount in €" name="writtenamount">
<a type="submit" href="<?php echo base_url();? >index.php/moneyexchange/invest_first_page">invest</a>
</form>
但由于某些原因,我无法从视图文件中的输入字段中获取值,请帮助。
它表明我的$userPRovidedAmount是一个(bool)假值。但我需要从输入变量中获取数字
您的“提交”按钮所在的位置有一个链接。链接不会提交表单(除非有一些看不见的javascript)-它只会向页面发出常规的
GET
请求(因此为什么POST
在控制器中为空)
更改表单的操作,并使“提交”按钮成为表单元素:
<?php echo form_open('moneyexchange/invest_first_page'); ?>
<input id ="Amount" type="text" placeholder="Amount in €" name="writtenamount"/>
<input type="submit" value="invest"/>
<?php echo form_close();?>
非常感谢!!我不知道链接在表单上不起作用。@Farhana没问题,很高兴我能帮助你你擅长击倒js吗?我正试图从控制者那里得到这些信息,你知道吗?@Farhana我恐怕没有击倒JS的经验,对不起
<?php echo form_open('moneyexchange/invest_first_page'); ?>
<input id ="Amount" type="text" placeholder="Amount in €" name="writtenamount"/>
<input type="submit" value="invest"/>
<?php echo form_close();?>