简体   繁体   中英

can anyone help me how to pass the results of separately to other page when schedule is clicked

1.

 <?php
    $sql = "(SELECT id,Firstname, Lastname, MI, Course, Date_Enrolled FROM  listofstudents )";
    $result = mysqli_query($con, $sql);
    $num_rows = mysqli_num_rows($result);
    if ($num_rows > 0){ // build a table to show results
        while($row = mysqli_fetch_array($result)){
            echo "<tr>";
            echo "<td align='center'>" . $row['Firstname'] . "</td>";
            echo "<td align='center'>" . $row['Lastname'] . "</td>";
            echo "<td align='center'>" . $row['MI'] . "</td>";
            echo "<td align='center'>" . $row['Course'] . "</td>";
            echo "<td align='center'>" . $row['Date_Enrolled'] . "</td>";
            echo "<td align='center'> <a href='schedule.php?name=".$row['Firstname']."lastname=". $row['Lastname'] . " mi=". $row['MI'] ."'>Schedule</a></td>";
            echo "</tr>";
        }   
    } else{
        echo "No rows returned.";
    }
?>
  1. List item

您在 url 中发送数据是不安全的您可以发送 tha ID,在请求的页面上,您可以通过 sql 查询获取该行。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM