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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:53:50+00:00 2026-05-29T22:53:50+00:00

My PHP: if($count == 1 && $user_level < 4 && $if_active == 1) {

  • 0

My PHP:

if($count == 1 && $user_level < 4 && $if_active == 1)
{
$response = array("success" => true); 

//The login stuff happens here

echo json_encode($response); 
}

elseif($count == 1 && $user_level < 4 && $if_active == 0)
{
$response = array("success" => not_act);  
echo json_encode($response);  
}
else 
{
$response = array("success" => false); 
echo json_encode($response); 
}

The JQuery that sends and recieves the data from that PHP file

$('#login_form').submit(function(){ 
        var emailB = encodeURIComponent($('#email_B').val());   
        var passwordB = encodeURIComponent($('#password_B').val());   
        $('#wrapper').fadeOut(); 
        $('#login_effect').fadeIn(); 
        $.ajax({ 
            type: 'POST', url: 'checklogin.php',  dataType: "json",  data: { email: emailB, password: passwordB,  }, 
            success: function(result) {                 
                if (!result.success) { timeout = setTimeout(function(){ $('#login_effect').fadeOut(); }, 1500); $('#wrong_password').fadeIn(); }  
                else if (result.success == not_act) {timeout = setTimeout(function(){ $('#login_effect').fadeOut(); }, 1500); $('#not_act').fadeIn();}
                else { timeout = setTimeout(function(){ $('#login_effect').fadeOut(); }, 1500); document.location.href='http://matchmingle.net/profile/'; } 
            }  
        }); 
        return false; 
    }); 

This works fine and dandy EXCEPT for the not activated part. How do I find out in the JQuery what the JSON returned besides just true and false? I tried to

$response = array("success" => not_act);  

and then in the JQUery

else if (result.success == not_act) {do cool stuff}

but I can’t get it to work because I’m obviously doing it wrong. BTW I’m very new to this JQuery/JSON/Javascript, what you’re seeing me do is what I’ve learned from a dummies book over the corse of a few weeks and a bunch of help from you guys.

So yeah, what’s the proper way to set the json response variable and find out what it’s value is in the JQuery?
Thanks a bunch
-Mike

  • 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-29T22:53:52+00:00Added an answer on May 29, 2026 at 10:53 pm

    I think that you need to add quote mark

    in your php:

    $response = array("success" => "not_act");
    

    and in your javascript:

    else if (result.success == "not_act") {/*do cool stuff*/}
    

    because not_act seem to be a variable name, and I don’t see if this variable have the same value in your php code and in your javascript one.

    By surrounding with quote mark, it will now be a string.

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

Sidebar

Related Questions

if(count > 0){ for(var i= parseInt(start); i < parseInt(count); i++) { link ='<a href=/diabetes/ropimages/origpicdisplay.php?pid='+pid+'&rid='+i+'
I know the function count() of php, but what's the function for counting how
How can we count space between text in PHP? example: hi how are you?
We've got a PHP application and want to count all the lines of code
PHP, for all its warts, is pretty good on this count. There's no difference
Is it possible to do a simple count(*) query in a PHP script while
$.post(/diabetes/ropimages/getcount.php,{pid:$(#patient_id).val()} ,function(data1){ //alert(data1); var count = data1; var pid = $(#patient_id).val(); var rid; for(
I am trying to write a PHP script that can upload multiple files. for($i=0;$i<count($_FILES['uploadimg']['name']);$i++){
I've a list of Q&A generated by php. Number of questions and answers in
I've got the following MySQL query: SELECT concat('<a target=_new href=%%WWWROOT%%/course/user.php?id=1&user=', u.id, '&mode=alllogs>', u.firstname ,'

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.