applicant_exam.php
<?php
$sql="SELECT jc.catergory_name,jc.catergory_id,j.role,j.job_id,ex.exam_paper_name,ex.exam_paper_id,ex.dateposted,ex.deadline FROM applicant a LEFT JOIN applicant_apply_job aaj ON a.email=aaj.email LEFT JOIN job j ON aaj.job_id=j.job_id LEFT JOIN job_catergory jc ON j.catergory_id=jc.catergory_id LEFT JOIN exam_paper ex ON j.job_id=ex.job_id WHERE ex.status='1' AND a.email='koshila827@gmail.com'";
$result = mysqli_query($dbcon, $sql);
?>
<table>
<caption>Available Exams</caption>
<thead>
<th>Category Name</th>
<th>Role</th>
<th>Exam Paper Name</th>
<th>Dareposted</th>
<th>Closing Date</th>
<th>Action</th>
</tr>
</thead>
<?php
while($row = mysqli_fetch_array($result)){
?>
<tr>
<td><?php echo $row["catergory_name"]; ?></td>
<td> <?php echo $row["role"]; ?></td>
<td><?php echo $row["exam_paper_name"]; ?></td>
<td> <?php echo $row["dateposted"]; ?></td>
<td><?php echo $row["deadline"]; ?></td>
<td>
<a href="start_exam_paper.php?exid=<?php echo $row['exam_paper_id'];?>&catid=<?php echo $row['catergory_id'];?>&jobid=<?php echo $row['job_id'];?>">
<button id="start" class="delBtn"><i class="fa fa-arrow-circle-right"></i> Start Exam</button>
</a>
</td>
</tr>
<?php
} ?>
</table>
点击applicant_exam.php中的“开始考试”按钮后,重新加载到“start_exam.php” 如何隐藏“点击后的开始按钮”。 当用户可以在Web浏览器中单击后退按钮时,按钮要隐藏
答案 0 :(得分:0)
在按钮上使用Javascript:
hover
隐藏按钮,直到会话关闭。 将会话存储用作:
:
答案 1 :(得分:0)
您可以通过在php中使用会话来实现此目的。
在applicant_exam.php中添加此
<?php
//start session
if (session_status() == PHP_SESSION_NONE) {
session_start();
$_SESSION["Visibility"] = "visible";
}
$sql="SELECT jc.catergory_name,jc.catergory_id,j.role,j.job_id,ex.exam_paper_name,ex.exam_paper_id,ex.dateposted,ex.deadline FROM applicant a LEFT JOIN applicant_apply_job aaj ON a.email=aaj.email LEFT JOIN job j ON aaj.job_id=j.job_id LEFT JOIN job_catergory jc ON j.catergory_id=jc.catergory_id LEFT JOIN exam_paper ex ON j.job_id=ex.job_id WHERE ex.status='1' AND a.email='koshila827@gmail.com'";
$result = mysqli_query($dbcon, $sql);
?>
现在在锚点,
<a href="start_exam_paper.php?exid=<?php echo $row['exam_paper_id'];?>&catid=<?php echo $row['catergory_id'];?>&jobid=<?php echo $row['job_id'];?>"
//this will set the visibility
style="visibility:<?php echo $_SESSION["Visibility"]; ?>">
<button id="start" class="delBtn"><i class="fa fa-arrow-circle-right"></i> Start Exam</button>
</a>
现在在start_exam.php中,在顶部执行此操作,
<?php
$_SESSION["Visibility"] = "hidden";
?>
因此,当用户回到applicant_exam.php时,可见性将被隐藏,因此它不会出现。