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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:04:41+00:00 2026-05-14T22:04:41+00:00

I’m having a miserable time debugging one small function on my new project. Essentially

  • 0

I’m having a miserable time debugging one small function on my new project.

Essentially I’m having a user log out via an AJAX call to my log out script on my server called “userfFunctions.php” I’m using AJAX so that I don’t have the headache of writing more regex to match my mod_rewrites. Anyway, every so often, it seems as though my Post data just flat out dies and since the PHP is running behind the scenes, I feel like I have no way of finding out where the data flow is being disrupted. BTW This function works 19 hrs of the day.

Here is the javascript function:

function logOut(){
    var data = new Object;
    data.log_out = true;
    $.ajax({
        type: 'POST',
        url: 'http://www.mydomain.com/User_Validator', //<-- redirects to userFunctions.php
        data: data,
        success: function(data) {
        alert(data); // <-- a response is triggered but with no response data!
        }
    });
}

the php side:

if(isset($_POST['log_out'])){
     echo 'alert this!';
}

here is my awesome response:
alt text http://img517.imageshack.us/img517/6520/screenshot20100517at443.png

  • 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-14T22:04:42+00:00Added an answer on May 14, 2026 at 10:04 pm

    FirePHP:

    FirePHP enables you to log to your
    Firebug Console using a simple PHP
    method call.

    All data is sent via response headers
    and will not interfere with the
    content on your page.

    FirePHP is ideally suited for AJAX
    development where clean JSON and XML
    responses are required.

    Here is a minimalistic implementation I wrote:

    function FirePHP($message, $label = null, $type = 'LOG')
    {
        static $i = 0;
    
        if (headers_sent() === false)
        {
            $type = (in_array($type, array('LOG', 'INFO', 'WARN', 'ERROR')) === false) ? 'LOG' : $type;
    
            if (($_SERVER['HTTP_HOST'] == 'localhost') && (strpos($_SERVER['HTTP_USER_AGENT'], 'FirePHP') !== false))
            {
                $message = json_encode(array(array('Type' => $type, 'Label' => $label), $message));
    
                if ($i == 0)
                {
                    header('X-Wf-Protocol-1: http://meta.wildfirehq.org/Protocol/JsonStream/0.2');
                    header('X-Wf-1-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3');
                    header('X-Wf-1-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1');
                }
    
                header('X-Wf-1-1-1-' . ++$i . ': ' . strlen($message) . '|' . $message . '|');
            }
        }
    }
    

    I wrote it so that it only works on localhost (for security reasons), but you can easily change that by replacing the following code:

    if (($_SERVER['HTTP_HOST'] == 'localhost') && (strpos($_SERVER['HTTP_USER_AGENT'], 'FirePHP') !== false))
    

    With:

    if (strpos($_SERVER['HTTP_USER_AGENT'], 'FirePHP') !== false)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 381k
  • Answers 381k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I updated my answer on your other (related) question. In… May 14, 2026 at 10:05 pm
  • Editorial Team
    Editorial Team added an answer probably what you are seeing is not a real "backslash… May 14, 2026 at 10:05 pm
  • Editorial Team
    Editorial Team added an answer I wouldn't use the ans.Where(x => false).ToList() versions these iterate… May 14, 2026 at 10:05 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.