这是我的代码
<input type= "submit" value="load" name="load" onclick="form.action='inputmarks.php?epr=save'"><input type="submit" value="submit" name='submit' id="submit" onclick="form.action='inputmarks.php?epr=go'">
<?php if(isset($_GET['epr']))
$epr=$_GET['epr'];
if($epr = 'save')
{echo "<p><input name='newcourseID' value='$courseID'>         <input name='newsessionID' value='$sessionID'>         <input name='newtermID' value='$termID'>";echo "ok1";}?>
<?php
if($epr = 'go')
{$connect = mysqli_connect($hostname,$username,$password,$databaseName);
for ($y = 0; $y < $student; $y++) {
for ($x = 1; $x <= $num; $x++){
$a=$studentID[$y];
$b=$marksID[$x];
$sql9 =" INSERT INTO tbl_course_marks_result(CourseID,SessionID,TermID,StudentID,MarksID) VALUES ('$courseID2','$sessionID2','$termID2','$a','$b') ";
$result9= mysqli_query($connect,$sql9);
echo "submit";
}
}
}
我在这段代码中的问题是;当我点击加载按钮时它也会执行提交按钮的工作,当我点击提交按钮时它也会执行加载按钮的工作。但我想为每个按钮只设一个指定的功能。