Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5961203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:55:56+00:00 2026-05-22T18:55:56+00:00

i have a system with a login. Then, the user made the login and

  • 0

i have a system with a login. Then, the user made the login and he have access to private stuff (personal data).

i need to recognize what user made the login to get his stuff. so, i need something like this: $nameUser=$_SESSION['u_name'] correct? then i can do the queries like that :

Select photo*from tablePhotos where name= $nameUser.

The code that i have is appropriated, or it has problems of Security?
It is indicated generate a session_id for each session?makes sense? what is the “rule”?

I don’t have much experience with sessions…

 <?php
    session_start();

    if(empty($_SESSION['u_name']))
    header("Location:index.php");   

    if(isset($_GET['logout'])) {
        session_destroy();
        header("Location:emprego.php");
    }

    $name = $_SESSION['u_name'];
    echo $name ;

    echo "<a href='secure.php?logout'><b>Logout<b></a>";

    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:55:56+00:00Added an answer on May 22, 2026 at 6:55 pm

    As long as you always sanitize your data and use queries like

    "Select * from tablePhotos where name= '" . mysql_real_escape_string($nameUser) . "'"
    

    everything is fine

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have detailed stats on user access to my system detailing login and logout
Assume that I have login to system using PHP + MySQL, then, after I
I have installed 1.1.9 Yii framework.Then I made copy paste user module in my
i have a user login system which works off of sessions such that when
I have a login system, and while logged in, if I refresh the browser,
Im looking to have a login system on my asp.net mvc website and at
I have a database system developed in mysql and php, with a login system
We have a typical web-based login system. We want customers to have the ability
I have a simple file-system-ed-login (not mysql) just to track number of users who
This aspect of my login system works just fine if I have the return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.