HTML
<p style="text-align:center"><span style="font-size:24px">腦筋急轉彎-新增</span></p> <form method="post" name="add"> <p>題目:<input name="xxxx" required="required" type="text" /></p> <p>答案:<input name="xxxx" required="required" type="text" /></p> <p><input name="submit" type="submit" value="確定" /></p> </form>
PHP
<?php include("config.php"); header("Content-Type: text/html; charset=utf-8"); if($_POST['submit']) { $sql_query = "INSERT INTO think (`xxxx`, `xxxx`) VALUES ('$_POST[xxxx]','$_POST[xxxx]') "; $db_link->query($sql_query) or die("錯誤:".$sql_query); //echo $sql_query."<br>"; } ?>
隱藏答案
<a href="#" onclick="alert('<?php echo $row[xxx]; ?>')">答案</a>