我有一个名为 profile.php 的 php 文件,如果您在 URL 中键入 mywebsite.com/profile.php,您将转到您的个人资料,我希望其他个人资料显示为与其 ID 的链接,例如让我们说我想查看 Bob 的个人资料,他的 ID 是 25,我会去 mywebsite.com/profile.php?ID=25 或类似的东西,我该如何实现?
谢谢你。
伙计们,我在这方面遇到了很多麻烦,所以这是我为 profile.php 提供的代码,也请让我知道当用户单击名称时我应该怎么做,这也需要他们进行配置,这有很多麻烦伙计们谢谢你们!!
<?php
session_start();
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] == false) {
header( 'Location: index.php' ) ;
exit;
}
include('get-info.php');
if ($_SESSION['email']) {
}else{
header( 'Location: profile.php' ) ;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="Icon" href="images/ricon.ico" >
<title>
Rate-Away | Profile
</title>
<link href='css.css' rel='stylesheet' type='text/css' />
</head>
<body class='home-body' >
<div class='home-nav-bar'>
<div class='home-nav-bar-content'>
<a href="home.php"><img src='images/rateaway.png' class='home-nav-bar-logo' /></a>
<div class='home-nav-bar-links-container' >
<div class='dropdown'>
<ul>
<li class='nav-options'>
<a href="#" class='options-link' >Options</a>
<ul class='drop-down-options'>
<li><a href="home.php" class='drop-down-links'>Home</a></li>
<li><a href="#" class='drop-down-links'>Profile</a></li>
<li><a href="settings.php" class='drop-down-links'>Settings</a></li>
<li><a href="logout.php" class='drop-down-links'>Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class='home-main-content' >
<div class='profile-current-info'>
<p class='profile-name'> <?php get_info($_SESSION['email'], 'name'); ?> </p>
<img src='<?php get_info($_SESSION['email'], 'profilepic'); ?>' class='profile-pic'/>
<p class='profile-dob' > Born: <?php get_info($_SESSION['email'], 'dob_day'); ?> </p>
<p class='profile-country' > Currently lives in: <?php get_info($_SESSION['email'], 'country'); ?> </p>
<p class='profile-gender' > Gender: <?php get_info($_SESSION['email'], 'gender'); ?> </p>
</div>
<div class='profile-edit-info' >
</div>
</div>
</body>
</html>