1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    sdeshmukh1983 is on a distinguished road

      0  

    Default $_POST RETURNS BLANK IN MY EXTJS FORM (PLEASE HELP)

    $_POST RETURNS BLANK IN MY EXTJS FORM (PLEASE HELP)


    We are seeing a strange issue in our Extjs form, where when we submit the form, either $_POST variable is totally blank or some values of $_POST variable truncates (They truncate string of that variable which we pass through Ext.encode or json.stringify).

    Interesting points in our issue is that it is coming intermittently and if we once get this issue but then if we do another try to submit the form with same value which we previously entered, would post form successfully.

    Following are our ExtJs form structure:

    var form = new Ext.FormPanel({
    title : ' ',
    shadow:true,
    url: 'form-submit.php',
    width : 850,
    frame:true,
    style: "text-align:left",
    name:'formPanelID',
    id:'formPanelID',
    autoHeight:true,
    defaults: {
    layout: 'form'
    },
    listeners:{
    show: {
    fn: function(){
    form.form.clearInvalid();
    } } },
    buttons: [
    {
    id:'saveButtonBottom',
    type: 'button',
    listeners: {
    'click': {
    fn: function(evt, btn){
    submitForm(form); // Inside submitForm() we are doing some stuff and then submit form using form.getForm().submit({...});
    }}}}]
    });
    In this form we are adding each field by first making a container then add items in to that container and then add container in to main form like:

    var item = new Ext.Container({
    layout:'form',
    border:true,
    labelAlign:labelAlign,
    id:'wrapID'
    });
    and then through form.add().

    Now when we submit this form, some weird things happen to $_POST like:
    1. Sometimes $_POST is completely empty.
    2. Sometimes some variables truncates like suppose we have field variable which has value "[\"main_panel\",\"online\", \"hello1\",\"hello2\"] then after post it would be $_POST['fields'] = "[\"opened_main_panel\",\"online".
    3. Sometimes out of 20-25 input fields only 5-6 fields getting posted.

    Some more inputs/findings from our log file after doing some R&D :
    1. It is happening for IE browser mostly (Not all the logs are from IE but most of them).
    2. We have tried to check php://input at server side after posting form, but it also comes with blank value.
    3. We are sending about 30-40 (sometime more than this) input fields from our extjs form.
    4. We thought it might be a problem of sending large number of fields so, to check we had sent only one normal Extjs request before posting form containing only one parameter but length of that parameter is around 1000-1200 characters, but again sometimes that variable posted with blank value.
    5. As per our knowledge POST does not depend on parameter length (which we have restriction for GET). but then also Could parameter length be a problem?
    6. We have checked as much as php/apache settings which we were asked to check when we were going to find answer on internet (You can check this through phpinfo.php file).
    7. We also tried to use $_REQUEST variable instead of post at server side but could not get luck on this. (Same thing empty values)
    8. One thing we want you to notice is that our register_global is set to 'on'.
    9. We have also checked for content type it is set to Content-Typetext/html; charset=ISO-8859-1 in our header request. we also tried to check this at our server side file like:

      if(empty($_SERVER['CONTENT_TYPE'])){
      $type = "application/x-www-form-urlencoded";
      $_SERVER['CONTENT_TYPE'] = $type;
      }
    10. We have also checked our keepalive setting in our config file.
    11. We are also doing some stuff related to changing array to string by Ext.encode and YAHOO.lang.JSON.stringify().
    12. We also thought it may be because of proxy setting but later we assumed that if it had been because of proxy setting then user can get the same issue every time but we are getting issue intermittently.

    my apache/php config settings

    php version 5.3.14
    apache 2.0.
    Extjs 3.3

    max_input_time 60
    max_input_var 1000
    post_max_size 16M
    register_globals on


    Please help me to resolve this issue..


    Regards,
    Sourabh
    sdeshmukh1983@gmail.com

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,990
    Vote Rating
    455
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    What is your failure rate in other browsers? Is this just an IE issue?
    Is your header data intact? I would suggest sending as JSON.

    Is the failure rate related to different data, or intermittent in all cases? Is there a change you have invalid data?
    [\"main_panel\"
    You should not have to send quoted array data that may be causing issues.

    If you decrease the amount of data sent (say half), does this affect the failure rate?
    Can you send a large hard coded json string in a ajax request, what happens?

    Scott.

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    sdeshmukh1983 is on a distinguished road

      0  

    Default


    Thanks for replying scott

    Failure rate is very low in other browser say 1 in 20 times.

    We have also tried using json.stringify() to encode and sending data.

    Even if we pass a string containing 1000-1200 characters, sometimes its also posting blank, so i think its not about json or encoding..

    suppose we have an array containing 5 string, then it will be "" in that array. so i think i can not do much in it.

    For your last question, about decrease the length of string - Sir we have that requirement where a string can have large number of text (suppose there is a text area or editor), I think large number of char should not be a problem in POST..We can not decrease or break character string..

    Please help

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,047
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Please do not post duplicate threads
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 2

Tags for this Thread