1. #1
    Ext User
    Join Date
    Nov 2007
    Posts
    13
    Vote Rating
    0
    onmission is on a distinguished road

      0  

    Question Login Form Issue - How to Submit and Check the data

    Login Form Issue - How to Submit and Check the data


    Hi,

    I am still new with the Ext.js, after testing around with it these 2 days, finally managed to know how the individual put together to create a login form.

    However, I am currently stuck in the midst of making the form lookup upon the php for the valid user check.

    This is submission of the login.js
    Code:
    ...
    buttons: [{
    text: 'Login',
    tooltip: 'Login to System',
    handler: function(){
    myform.form.submit({
    url:'check.php', 
    waitMsg:'Validating User...',
    success: function(form, action) {
    	Ext.MessageBox.alert('Login Success', 'You have successfully log in.');
    },
    failure: function(form, action) {
    	Ext.MessageBox.alert('Login Failed', 'Please check your Username and Password.');
    }
    });
    }
    }]
    ...
    And here's the simple PHP code I did for testing (check.php):
    PHP Code:
    <?php
    if (($_POST['username'] == "user") && ($_POST['password'] == "test")) {
        echo 
    "login success";
    } else {
        echo 
    "invalid login";
    }
    ?>
    I still can't figure out what is supposed to replace echo "login success", if validation is correct, and what is to be replace for echo "invalid login" if the login input is either empty or invalid, so that my message box will return correctly.

    Kindly advise. Thanks.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    You have to return the data as JSON. At a minimum,
    Code:
    {success: true/false}

  3. #3
    Ext User
    Join Date
    Nov 2007
    Posts
    13
    Vote Rating
    0
    onmission is on a distinguished road

      0  

    Default


    Thanks Tim,

    I have finally figure out what you meant by that. I downloaded the JSON from Wolfgang and set it to generate the result to true/false.

    Never used JSON before. That's why I have no single idea about linking it. Thanks.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."