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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:57:14+00:00 2026-06-02T14:57:14+00:00

All i want is, a data will pass into this php file: check.php and

  • 0

All i want is, a data will pass into this php file: check.php and this php file will pass data into that function when the page is ready. this is just an expirement.

ok I have this code:

$(document).ready(function() {
    $.post("check.php", {
        name: "log"
    }, function(data) {
        if (data === "yes") {
            alert('has been login');
        } else {
            alert('has not login');
        }
    });
});​

and i have this php code (“check.php”) where the jquery post will pass the data into.
​

<? //check
$chk = $_POST['name'];

if (isset($chk === "log")) {
    if (isset($_COOKIE['admin'])) {
        if ($_COOKIE['admin'] === "login") {
            echo "yes";
        }
    } else {
        echo "no";
    }
} else {
    echo "no";
}
?>

but nothing happen, even i change the whole code in check.php into: “echo “yes”;” theres nothing happen, i guess, its either there is no data receive or there is no data pass. Hope someone could help me into this simple and cute problem that im stuck with. thank you in advance

  • 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-02T14:57:15+00:00Added an answer on June 2, 2026 at 2:57 pm

    I think you missed a closing brace. This just works as expected:

     $.post('check.php', { name: 'log' }, function(data) { 
         if (data === "yes") 
          { 
             alert ('has been login'); 
           } 
           else 
         { 
         alert ('has not login'); 
         } 
      });
    

    Run this JSFiddle http://jsfiddle.net/S53k5/
    and you will see the call passing by in Fiddler.

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

Sidebar

Related Questions

I want to do something like this: c:\data\> python myscript.py *.csv and pass all
I want to store all of the data that is kept in encoding_symbols_tab [0]
I just want to intercept raw data (hex)--headers and all--sent to a port, and
I just want to know a easy way to extract all data with same
In our ColdFusion application we have stateless model objects. All the data I want
I want to be able to log all JMX data accessible via jconsole. Is
I want to display JQGrid with all column headers but without any data rows
In my code, I want to view all data from a CSV in table
Put simply, I want to select all data in two columns from each of
Ok, so I want to create a database with all the data of the

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.