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

  • SEARCH
  • Home
  • 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 8774819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:39:49+00:00 2026-06-13T18:39:49+00:00

if($_POST[‘user’] == ‘anita’ && $_POST[‘pw’] == ‘123’) { $_SESSION[‘username’] = $_POST[‘user’]; echo Welcome, .

  • 0
if($_POST['user'] == 'anita' && $_POST['pw'] == '123')
{
    $_SESSION['username'] = $_POST['user'];
    echo "Welcome, " . $user;
    $loggedin = true;
}else
{
    die('Log in details incorrect.');
}

if(isset($_SESSION['username']))
{
   // Show website edit menu
}

I’m creating a website and I was thinking about adding a small self made CMS for my customer to use, so she can update the site herself.

Is this a safe way to save someones details? can I just check if $_SESSION[‘username’] is set to validate that the user is logged in?

  • 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-06-13T18:39:50+00:00Added an answer on June 13, 2026 at 6:39 pm

    Well, yes.
    Setting a session on a server side it pretty safe, as it means the hacker will have to get access to server files writing, or find a really horrible bug in your client code that leads to file rewrites.

    Just do some research for: session fixation and how to prevent it, and try to use SSL on the CMS side.

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

Sidebar

Related Questions

post.php?replyto=username&othervariable=value For example, if I click a link with this url, then I want
Post :belongs_to :user User :has_many :posts In my signup workflow they draft a Post
post '/upload' do unless params[:file] && (tmpfile = params[:file][:tempfile]) && (name = params[:file][:filename]) return
$op=$_POST['param']; $statement=eval(return ($op);); in 'param', if there is a strange character such letter 'jfsdf'
Post s belong to User s. User s have and belong to many roles
$_POST['asdf'] = 'something'; function test() { // NULL -- not what initially expected $string
POST /upload HTTP/1.1 Host: assets.drop.io User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10)
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Post has user and date attributes. How can I turn this posts = Post.objects.order_by('-date')[:30]
$arrayOfEmails=$_POST[arrayOfEmails]; 1st question: $arrayOfEmails is now just an array in JSON notation. How would

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.