error with a random behaviour

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
zg2pro
Forum Newbie
Posts: 3
Joined: Wed Apr 21, 2010 5:08 am

error with a random behaviour

Post by zg2pro »

Hi,

First sorry I didn't know where to post, because, obviously, I can't identify where is the root cause of my bug between js script, php or the apache config.

I have on my website, a login webpage run with Ajax: no page refresh in case of wrong password, if ok then login and redirect.
My problem is that when Ajax is supposed to send the ID and password to the PHP script, sometimes it does (I can see it in the logs and the session is properly opened on the site) and other times, PHP script doesn't receive any input (in the logs I will find: "SELECT * FROM account_web WHERE username = ''")

I'd say that it occurs 50% of the time. It has been more than a week we have this error, wamp server was rebooted many times... Sometimes, during 10 minutes we try to connect in vain, it doesn't work and suddenly... connection !

To give you some spare indications, here is the js script run when clicking on button "connection":

Code: Select all

<script type="text/javascript">
    $(document).ready(function(){
        $("#verify").bind("click",function(){
            $("#verify").hide();
            fVerify();
        });
    })
 
    function fVerify(){
        if(tmt.validator.validateForm(document.getElementById("login"))){
            $.post(
                "<{$smarty.const.APPLICATION_URL}>IPay/signin/verify",
                $("#login").serialize(),
                function(data){
                    if(data.value==true){
                        window.location = "<{$smarty.const.APPLICATION_URL}>IPay/users/orders/?lang=<{$hl}>";
                    }else if(data.value==false){
                        alert(data.message);
                        //Recaptcha.reload();
                        $("#verify").show();
                    }
                },"json"
            )
        }
    }
    
    function fShowMessage(message,is_model){
        if(is_model){
            $("#thickbox").attr("href","#TB_inline?inlineId=message&modal=true&width=400&height=100");
            
        }else{
            $("#thickbox").attr("href","#TB_inline?inlineId=message&width=400&height=100");
        }
        $("#content").html(message);
        $("#thickbox").click();
    }
 
</script>
the form (#login) sends data by POST to the script (IPay/signin/verify)

Because the error is random, we don't know where we can search, anyone got a clue ?
Post Reply