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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:06:12+00:00 2026-05-25T23:06:12+00:00

Probably some simple derp but I just can’t figure this out, I’m using almost

  • 0

Probably some simple derp but I just can’t figure this out, I’m using almost identical code in a different solution and it works.

Javascript:

$('#drop').click(function(e) {
    e.preventDefault();
    $('#login').slideToggle(1000);
});

$('#sub').click(function(e) {
    e.preventDefault();
    $('#info').html('<img src="img/load.gif" />')
    $.post('login.php', {user: document.getElementById('user').value, pass: document.getElementById('pass').value}, function(response) {
        if (response == 'ok')
        {
            $('#login').slideUp(500);
            $('#info').html('');
            $('#joocy').html('<img src="img/load.gif" />').load('manage.php');
        }
        else if (response == 'error')
        {
            $('#info').html('Invalid user/pass');
        }
    });
});

PHP:

if ($row = mysql_fetch_array($result))
{
    echo 'ok';
}
else
{
    echo 'error';
}

Response is being sent back but the if-clause isn’t catching it. typeof() returns string.

EDIT:
else if (response === ‘error ‘) // notice the space in the string

This works, can anyone explain why the space is appended to the returnstring?

SOLVED: There was a space after PHP closing tag. Thanks for your time everyone! 🙂

  • 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-25T23:06:13+00:00Added an answer on May 25, 2026 at 11:06 pm

    You probably have a space after the closing ‘?>’ tag in your php script. Try either removing all whitespace after, or the closing tag altogether.

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

Sidebar

Related Questions

This is probably some simple mistake, I just can't seem to find it in
I'm using .Net 2.0 and this is driving me crazy but there's probably some
I'm having some issues with my code. This is probably due to some design
Probably a really simple one this - I'm starting out with C# and need
Where can I find some simple sample code for public key encryption and decryption
This is probably an oldie-but-goodie. I am using System.Data.Common for an interchangeable Oracle/SQL Server/SQLite
I am wondering if someone could help me with some probably rather simple code,
I was searching Google for a page offering some simple OpenMp algorithms. Probably there
I'm using custom WordPress categories for some probably unintended functions, I will admit (things
Title probably doesn't make a lot of sense, so I'll start with some code:

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.