我已经创建了一个用户个人资料页面。使用下面写的代码。我正在尝试为每个用户个人资料页面提供一个唯一的ID / url,以便其他人可以查看。
这是正确使用的技术还是更实用的技术?
<?php session_start();
if(isset($_SESSION['signed_in']) && $_SESSION['signed_in'] == true)
{
include($_SERVER["DOCUMENT_ROOT"] . "/inc/database3.php");
$userid = $_SESSION['user_id'];
$username = $_SESSION['username'];
$useremail = $_SESSION['useremail'];
$userdate = $_SESSION['userdate'];
$pageTitle = $username . ''s Profile';
$pageCategory = $username . ''s Profile'; /* ' */
$pageCategoryurl = '/profile.php';
include($_SERVER["DOCUMENT_ROOT"] . "/inc/header.php");
include($_SERVER["DOCUMENT_ROOT"] . "/inc/search.php");
echo '<div class="content">';
echo '<h2 align="center">' . $username . ''s Profile</h2>';
echo '<ul class="ulstyle">';
echo '<li>Your user id number is ' . $userid . '.</li>';
echo '<li>Your user name is ' . $username . '.</li>';
echo '<li>Your email address is ' . $useremail . '.</li>';
echo '<li>The date you signed up for this website was on ' . $userdate . '.</li>';
echo '</ul>';
echo '</div>';
include($_SERVER["DOCUMENT_ROOT"] . "/inc/footer.php");
}
else
{
header('Location: /signin.php');
}
?>