简体   繁体   English

我正在尝试将我的学生列表与个人资料页面链接

[英]i am trying to link my student list with there profile page

i want to link each student name from student list with there profile page i have tried but its not working can any one solve this.Thanks in advance. 我想将学生列表中的每个学生姓名与我尝试过的个人资料页链接起来,但它无法正常工作,任何人都可以解决此问题。谢谢。

This is student list code and i am sending data to delete page for deleting any student from list and also i want link there names with there profiles if i want to check there profile. 这是学生列表代码,我正在发送数据以删除页面,以便从列表中删除任何学生,如果我要检查那里的个人资料,我也希望将那里的名字与那里的个人资料链接。

    <form action="php\student_list_delete.php" method="POST">
<table  id="table_style"  border="1px"  align="center">

        <tr>
        <td colspan="6" style="border-right: none;  border-bottom: none;">
        <h2>Student Information List</h2><b>Dempartment of Computer Sceince</b>
        </td>
        <td style="border-left: none; border-bottom: none;"><img src="images/logo.png" width="80px" height="80px"></td>
        </tr>


<!-- ============= Student Information List header Start here  ============= -->    
            <?php 

                std_list_header();

                ?>


<!-- ================= Student Information List header End here ================ -->    



        <tr class="table_header" >
        <th width="50px">S/N</th>
        <th>Name</th>
        <th>F/Name</th>
        <th>Session</th>
        <th>Semister</th>
        <th>Phone</th>
        <th>Delete</th>
        </tr>



<!-- ================= Student Information List body Start here ================ -->

<?php

    $query="SELECT id,name,fname,phone FROM  student"; 
$resultset=$connection->query($query); 

$count=0; 
while($r=$resultset->fetch_assoc()){
    $count++; 
echo "<tr><td>".$count."</td><td><a href='".$r["id"]."'>".$r["name"]."</a></td><td>".$r["fname"]."</td><td></td><td><td>".$r["phone"]."</td><td><input type='checkbox' name='chb".$count."' value='".$r["id"]."'></td></tr>
"; 

}
?>

<!-- ================= Student Information List body End here ================ -->


        <tr>
        <td colspan="7" align="right"><input type="submit" value="Delete"></td>
        </tr>

</table >
</form>

This is the student profile page code. 这是学生资料页面的代码。

function std_table_profile(){

$result=$connection->query("SELECT name,fname,gender,email,phone,address,image FROM student WHERE id='".$r["id"]."'");

$rs=$result->fetch_assoc();

".$res["name"]." “$水库[ ”名称“]。” to ".$r["name"]." 到“。$ r [“ name”]。”

lets say your link to the profile page looks like this 假设您指向个人资料页面的链接如下所示

/profile.php?id=32

in your profile page(profile.php) you retrieve id using $_GET 在您的个人资料页面(profile.php)中,您使用$_GET检索ID

<?php

  function std_table_profile($student_id){ 
     // your query...WHERE id='".$student_id."'"...
     return $result;
  }
  $id = $_GET['id'];
  $student_data = std_table_profile($id);
  print_r($student_data);

If you are using router you need to preg_match your uri 如果您使用的是路由器,则需要preg_match您的uri

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试从mysql下载文件,我将文件位置保存在数据库中,现在我正在尝试为页面上的用户创建下载链接 - I am trying to download a file from mysql, I saved the file location in the database, now I am trying to make a download link for the user on my page 我正在尝试将评论作者姓名链接到网站 url/profile/author 用户名 - I am trying to link the comment author name to site url/profile/author username 登录成功后如何在另一个活动(配置文件活动)中加载用户的数据库? 我正在尝试创建个人资料页面 - How to load database of a user in a another activity(profile activity) after login success? i am trying to create a profile page 我正在尝试访问我的插件页面之一,但未找到 - I am trying to access one of my plugins page but it is not found 我正在尝试通过view.phtml将相关类别链接添加到Magento中的产品页面 - I am trying to add related categories link to a product page in Magento via view.phtml 我想在单击链接后将页面包含在div中,但无法正常工作 - am trying to include a page in a div after i click a link but its not working PHP链接到个人资料页面 - PHP link to profile page 我正在尝试通过标头函数重定向页面,但是它无法正常工作,而是我的查询工作…为什么? - I am trying to redirect my page through header function but it will not work rather my query is working …why? 转到个人资料页面时尝试更改我的 URL 的一部分 - Trying to change a portion of my URL when going to profile page 我正在尝试为我的网站创建一个更改密码页面。 我究竟做错了什么? - I'm trying to make a change password page for my website. What am I doing wrong?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM