我需要有两个不同类型的输入:
<input type="button" **onclick = "?????"** name="back" value="← Back" >
<input type="submit" name="submit" value="Forward →" >
我该如何为 type=button 运行此 PHP 代码:
<?php
if (isset($_POST['back']))
{
$_SESSION['onpage'] = $_SESSION['onpage'] - 1;
$query_questionset = "
select Q.Constructor AS Constructor,
QS.QuestionIDFKPK AS QuestionIDFKPK,
Q.QuestionValue AS QuestionValue,
QS.SortOrder AS SortOrder,
QS.onpage AS onpage
from tbluserset AS US
inner join tblquestionset AS QS ON US.QuestionSetIDFKPK = QS.QuestionSetIDPK
inner join tblquestion AS Q ON QS.QuestionIDFKPK = Q.QuestionIDPK
where (US.UserIDFKPK = " . $UserId . ")
and (US.UserSetIDPK= '" . $_SESSION['UserSetIDPK'] . "')
and (QS.onpage = '" . $_SESSION['onpage'] . "')
order by QS.SortOrder";
}
$QuestionSet_Constructors = mysql_query($query_questionset);
?>
我的表单和输入提交工作完美:
<form id= "formID" class="formular" method="post" action= "<?= $url = "QUESTIONAREnewdatabase.php"; ?>" accept-charset="utf-8">
我需要什么input type=button
来运行 PHP 代码和类似 Back 的动作表单type=submit
?