view.php如何獲得一個特定超鏈接的價值在PHP,如果點擊,發送到另一個頁面的會話命名的鏈接
$result = mysqli_query($conn, "SELECT * FROM insgroup WHERE insID = '".$_SESSION['insID']."' ") or die ("Error selecting group from sessions:".mysqli_error($conn));
echo "<table border='1' cellpadding='10'>";
echo "<tr><th>Group ID</th><th>Group Name</th><th>Group Description</th><th>Group Subject</th><th>Group Department</th><th>Group Owner</th><th>Group Section</th><th>Group Year Level</th></tr>";
while($row=mysqli_fetch_array($result))
{
// set up a row for each record
echo "<tr>";
echo "<td>" . $row['groupid'] . "</td>";
echo "<td><a class='group-name' name='group-home-redirect' href='grouphome.php' >" . $row['groupname'] . "</a></td>";
echo "<td>" . $row['groupdesc'] . "</td>";
echo "<td>" . $row['groupsubject'] . "</td>";
echo "<td>" . $row['groupdept'] . "</td>";
echo "<td>" . $row['groupowner'] . "</td>";
echo "<td>" . $row['groupsection'] . "</td>";
echo "<td>" . $row['groupyearlevel'] . "</td>";
echo "<td><a name='delete-grp-btn' href='editgroup.php?id=" . $row['groupid'] . "'>Edit Group</a></td>";
echo "<td><a href='deletegroup.php?id=" . $row['groupid'] . "'>Delete Group</a></td>";
echo "</tr>";
}
echo "</table><br><br><NOSCRIPT><FONT COLOR='#FF0000'><BR>Javascript is required to access this area. Yours seems to be disabled.</FONT></NOSCRIPT> ";
if($result === FALSE){
echo "<script type='text/javascript'>alert('No rows for instructor' ".$_SESSION['insfname']." .".$_SESSION['inslname']." 'to be displayed.');</script>";
}
鏈接被命名爲「組家庭重定向」。當我創建一個組時,我希望顯示在視圖表中,並且如果用戶單擊組名稱,數據庫中該組的值將自動使用會話來調用。上帝我真的不知道,
什麼?你能否澄清你想達到的目標?它有點混亂。 – CodeGodie
這是什麼意思:_「如果用戶點擊組名稱,數據庫中該組的值將自動被調用」_? – CodeGodie
@CodeGodie,抱歉有點混淆,我只是想創建一個鏈接,對於視圖表中的特定組名稱,如果用戶單擊href鏈接,那麼該「組」的那些行表值將自動發送到另一個頁面並在grouphome.php中發佈信息。 – ProgrammerX