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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:19:56+00:00 2026-06-16T12:19:56+00:00

I have to process a Simple log-in File. In Many Web Tutorials I have

  • 0

I have to process a Simple log-in File. In Many Web Tutorials I have read that for any Ajax requests in jquery the callback function is function(data) and the data is returned by the server side script.

Well, my server side script is PHP. I wish to know how can I return data from PHP which will be stored in jquery’s data and I can use conditional loops to process them.

Here is my jquery Code:

$('#loginform').submit( function() {
        var querystring = $(this).serialize();
        $.post('login.php', querystring, processLI );
        function processLI(data) {
            if (data == 'success'){
            alert("Successful");
            var url = "game.php";    
            $(location).attr('href',url);
            }
            else 
                alert ('Login Failed');
        }

I am using simple return statement in my php file, which does not seem to work at all. here is the login.php file. I just posted the part necessary here.

$statement = $connection->prepare("SELECT * FROM users WHERE username = '$username'");
    $statement->execute(array());
    $result = $statement->fetch(PDO::FETCH_ASSOC);

    if ($result['password'] == $safepass) {
        setcookie("Login", true);
        echo 'success';

    }
    else 
        echo "Failure";
  • 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-16T12:19:57+00:00Added an answer on June 16, 2026 at 12:19 pm

    Use the echo statement to output data, if the login is successful echo 'success';

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

Sidebar

Related Questions

I have an log file that I need to extract specific patterns from. I
Consider we have a simple cycling Javascript process as: function test() { el=document.getElementById("test"); var
I have a simple script, which tries to kill an already running process. I
I have what may be a very simple question. I want to process a
I have Process objects that are monitored from two different views. A Windows.Forms.ListView (actually
I want to get specific counters for processes that I have process id's for.
I have a process where I read in a bunch of strings in ISO
I have a batch file which starts multiple instances of simple console application (Hello
We have a very simple ASP.Net page for uploading a file to our webserver.
I am working on building a simple proxy which will log certain requests which

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.