0
我正在研究一个简单的测验网络应用程序,我想验证提交按钮上的每个问题,显示正确的问题并添加标记。验证正确答案并在PHP测验中添加标记
我创建了我的第一个问题页这样
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cric Quiz </title>
<link href="<?php echo base_url(); ?>assets/style.CSS" rel="stylesheet" type="text/css"/>
</head>
<body>
<div>
<h1>Cric Quiz</h1>
</div>
<div id='quesNo'>
<center>Question 01</center>
</div>
<div id='questions'>
<center>When did Australia win their first ever world cup?</center>
</div>
<div id='answers'>
<input type="radio" name="year" value="1992">1992<br>
<input type="radio" name="year" value="1996">1996<br>
<input type="radio" name="year" value="2000">2000<br>
<input type="radio" name="year" value="2012">2012
</div>
<center><a href="<?=base_url().'index.php/Questions/question_2';?>" class="button1">Next</a></center>
</body>
</html>
我控制器
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Questions extends CI_Controller {
public function question_1()
{
$this->load->view('quiz_one');
}
public function question_2()
{
$this->load->view('quiz_two');
}
}
如何验证我的控制器我的答案
PS:我使用的是笨