誰知道爲什麼:代碼點火器POST變量
class Booking extends Controller { function booking() { parent::Controller(); } function send_instant_to_paypal() { print_r($_POST); echo '<hr />'; print_r($this->input->post()); echo '<hr />'; $id_booking = $this->input->post('id_booking'); $title = $this->input->post('basket_description'); $cost = ($this->input->post('fee_per_min') * $this->input->post('amount')); echo $id_booking; echo $title echo $cost } }
迴音必交的變量CI爲$ _ POST 但不是$這個 - >輸入 - >後();?
我有 $ this-> input-> post()在使用和在網站的其他地方的搜索頁面上工作...但在此頁面上,它不工作.. 這裏是我的表格.. 。
<form id="add_funds" action="' . site_url('booking/send_instant_to_paypal') . '" method="post"> <input type="text" name="amount" id="amount" value="" /> <input type="hidden" name="id_booking" id="id_booking" value="0" /> <input type="hidden" name="basket_description" id="basket_description" value="Adding Credit" /> <input type="hidden" name="fee_per_min" id="fee_per_min" value="' . $fee_per_min . '" /> <input type="submit" value="Add to basket" /> </form>
它的精神;-p 任何點什麼明顯的愚蠢我失蹤?
CI2.1 or CI1.X?看起來像CI1,這意味着你對'$ this-> input-post()'的調用是錯誤的 – Jakub 2011-03-23 17:56:46