User profile page in $_SESSION

Discussion in 'PHP' started by vOlLvEriNe, Aug 26, 2013.

  1. #1
    Hello dear Respected Experts, I have a problem, I Want to create a web site, and want to add a feature that every user can create his own page, like
    http://site.com/php
    http://site.com/digitalpoint
    Code (markup):
    And in this page, he can show what he want, E.g his info
    Please help me to create such a feature, i have simple $_SESSION system in my log-in system

    I Would be your thank full :cool::)
     
    Solved! View solution.
    vOlLvEriNe, Aug 26, 2013 IP
  2. cLogik

    cLogik Active Member

    Messages:
    159
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    90
    #2
    HELLo,

    You need to store the unique key and the information on the specific page. I assume the pages are not temporarily and only seen by the user. You can easily accomplish your task by using PHP and MySQL.
     
    cLogik, Aug 27, 2013 IP
  3. #3
    You will have to use mod rewrite in your htaccess file. Something like this:
    Options +FollowSymlinks -MultiViews
    RewriteEngine on
    #RewriteBase /
    
    RewriteRule ^member/([a-zA-Z0-9_\-]+)/?$ member/index.php?uname=$1 [NC,L]
    Code (markup):
    Then, in your directory called "member" you can grab the member's username as a $_GET[] variable and find it in your database:
    if(!isset($_GET['uname'])){
        $uname=$_SESSION['username'];//Use the username in the session because we have no username in the link
    }else{
        $uname=$_GET['uname'];//user clicked on link with a username, use that username instead
    }
    PHP:
     
    ekim941, Aug 28, 2013 IP
  4. vOlLvEriNe

    vOlLvEriNe Member

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    vOlLvEriNe, Aug 29, 2013 IP