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 8569697
In Process

The Archive Base Latest Questions

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

I wonder why is it not working? check_login.php <?php session_start(); $data = array(username =>

  • 0

I wonder why is it not working?

check_login.php

<?php
session_start();
$data = array("username" => "true");
echo json_encode($data);
?>

my js file
var linkName;

$.ajax({
    type: "POST",
    url: "check_login.php",
    dataType: "json",
    success: function(json){
    if(json.username != "true")
    {
      //do something
    }
    }
});

I am trying to get the username after checking whether or not the user has signed in yet in the php file, something like passing a session variable. But currently passing a string seems to already have a problem. Any know what I did wrong here?

Still not working the code above. Anyone want to help me out here?

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

    You have an error in your PHP code. The square bracket ] is not needed in line 3.
    And, of course you should use echo json_encode($data);

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

Sidebar

Related Questions

I`m wonder why this not working echo gettype($_GET['id']); //returns string if(is_int($_GET['id'])) { echo 'Integer';
I wonder why it is not possible a method parameter as var type like
i really wonder why assemblyResolver not working? Also i can not use foreach (byte[]
std::map<any, string> is not working so I wonder if there's another approach to have
I wonder why the following does not work with Visual studio typedef struct {
I wonder if I can keep ido from not remembering my history and only
I wonder how many users still have not upgraded their phones from version 2.2.1.
I just wonder if it is possible to only use CSS but not javascript
I wonder why F-Sharp doesn't support infinity. This would work in Ruby (but not
After looking around (for not terribly long I have to admit) I wonder if

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.