gpt4 book ai didi

php - 转到某人的个人资料

转载 作者:太空宇宙 更新时间:2023-11-03 12:07:26 24 4
gpt4 key购买 nike

我有这个用户列表页面,我希望用户能够单击用户的用户名,它会将他们发送到那里的个人资料页面,我将如何继续这样做?

这一行是用户点击用户名的地方

echo "<td class='info'><a href=''>". $people_list['username']."</a></td>";

同样在我的 .htaccess 中,我有一个代码,所以我转到用户配置文件,我所做的就是 http://www.example.com/username

<?php
include 'core/int.php';
include 'includes/head.php';
include 'head.php';
include 'includes/body.php';
include 'body.php';

$people_list="SELECT * FROM users";

$people=mysql_query($people_list);

?>
<html>
<head>
<style>
.owner {
color: orange;
}
</style>
</head>
<body>
<pre>
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Username</th>
<th>Email</th>
</tr>

<?php

while($people_list=mysql_fetch_assoc($people)){
echo "<tr>";
if ($people_list['username'] == KillerDucky1){
echo "<td>". $people_list['user_id']."</td>";
echo "<td class='warning'><a class='owner' href=''>". $people_list['username']."</a></td>";
echo "<td>". $people_list['email']."</td>";
} else {
echo "<td>". $people_list['user_id']."</td>";
echo "<td class='info'><a href=''>". $people_list['username']."</a></td>";
echo "<td>". $people_list['email']."</td>";
echo "</tr>";
}
}
?>
</thead>
</pre>
</body>
</html>

最佳答案

您只需将用户名放在 <a> 中链接标签:)

<a href='/".$people_list['username']."'>...</a>

关于php - 转到某人的个人资料,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25799968/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com