目前我在我看来使用如下代码,但图像没有显示我给出的内容,但它正在工作。
<input type="submit" id="button" name="submit" value="Generate Report" src="<?php echo base_url();?>images/Generatereports_btn.png" onmouseover="this.src='<?php echo base_url();?>images/Generatereports_high.png'" onmouseout="this.src='<?php echo base_url();?>images/Generatereports_btn.png'"/>
当我使用以下代码时,图像显示我给出的内容,但在控制器和模型中出现 php 错误。做错了什么以及我必须如何使用才能使其正常工作有人帮助我,请谢谢。
<input type="image" value="Generate Report" name="submit" id="button" src="<?php echo base_url();?>images/Generatereports_btn.png" alt="submit" onMouseOut="this.src='<?php echo base_url();?>images/Generatereports_btn.png'" onMouseOver="this.src='<?php echo base_url();?>images/Generatereports_high.png'>
我的控制器看起来像
function survey_demo_response()
{
$data['survey_details'] = $this->session->store['survey'];
if (isset($_POST['submit']) && $_POST['submit'] == 'Generate Report')
{
$questionData = $_POST['questions'];
}
if (empty($_POST['questions']))
{
$questionData = 1;
}
$data['question'] = $this->report_model->get_response_question($questionData);
$this->load->view('reports/survey_demo_response',$data);
}
我刚开始的错误是
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: questionData
Filename: admin/reports.php
Line Number: 90
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: models/report_model.php
Line Number: 1272