为用户个人资料页面提供唯一的url ID PHP

时间:2013-12-23 03:56:39

标签: php

我已经创建了一个用户个人资料页面。使用下面写的代码。我正在尝试为每个用户个人资料页面提供一个唯一的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 . '&#39;s Profile';

$pageCategory = $username . '&#39;s Profile'; /* &#39; */
$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 . '&#39;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');
     }


    ?>

0 个答案:

没有答案