问题是该方法是否具有类似
的参数功能索引($ product_id){
验证码同时创建2个图像并使我的输入码和验证码始终未匹配,但如果我删除了参数
function index(){
验证码仅创建1个图像,我的输入代码和验证码相互匹配...但我需要将参数放在我的索引()中,以便我可以将值从标记传递到控制器。有谁知道如何解决这个问题?
Eidt_product.php
class Edit_product extends CI_Controller {
function index($product_id) {
$msg = "Submit the word you see below:";
// Captcha configuration
$config = array(
'img_path' => 'captcha_images/',
'img_url' => base_url().'captcha_images/',
'img_width' => '150',
'img_height' => 50,
'word_length' => 5,
'font_size' => 16
);
$captcha = create_captcha($config);
// Unset previous captcha and store new captcha word
$this->session->unset_userdata('captchaCode');
$this->session->set_userdata('captchaCode',$captcha['word']);
$data['captchaImg'] = $captcha['image'];
$data['captcha_msg'] = $msg;
// $this->db->where('product_id', $product_id);
// $data['row'] = $this->db->get('tbl_products')->row();
$this->load->view('edit_product_form', $data);
}
}