Results 1 to 3 of 3

Thread: php is not responding.

  1. #1

    Exclamation php is not responding.


    Please see below.
    this image => https://picasaweb.google.com/lh/phot...eat=directlink

    this javascript code
    PHP Code:
                        handler: function() {
                            
    simple.getForm().submit({
                                
    method 'POST',
                                
    waitTitle:'??????',
                                
    waitMsg:'??????????????...',
                                
    success: function(options,response) {
                                    
    Ext.Msg.alert('?????????'response.result.data);
                                },
                                
    failure: function(options,response) {
                                    
    Ext.Msg.alert('???????',"?????????? <b>" response.failureType "</b>");
                                }
                            });
                        } 
    this php code
    PHP Code:
    <?php
    function mysqlConnect($host$user$password$database) {
        
    $con->mysql mysql_connect $host$user$password );
        if (! 
    $con->mysql)
            die ( 
    mysql_error () );
        
    mysql_select_db $database$con->mysql );
    }

    $json '[{"jobid":"0","description":"1","quantity":"2","unitprice":"3","duedate":"2011-05-11T00:00:00","discount":"4"},{"jobid":"0","description":"1","quantity":"2","unitprice":"3","duedate":"2011-05-11T00:00:00","discount":"4"}]';

    $arr json_decode($json);
    $con mysqlConnect("localhost""root""itsystem%*1""imc");
    foreach (
    $arr as $key => $value){
        
    mysql_insert_array(object2array($value), "order_items");
    }


    function 
    object2array($object) {
        if (
    is_object($object)) {
            foreach (
    $object as $key => $value) {
                
    $array[$key] = $value;
            }
        }
        else {
            
    $array $object;
        }
        return 
    $array;
    }

    function 
    mysql_insert_array($array$table) {
        
        
    $keys array_keys $array );
        
        for(
    $index 0$index count $array ); $index ++) {
            
            if (
    $index != 0) {
                
    $columns .= ",";
                
    $values .= ",";
            }
            
            
    /** construct the column names from the array **/
            
    $columns .= $keys [$index];
            
            if (
    is_int $array [$keys [$index]] )) {
                
    $values .= $array [$keys [$index]];
            } else {
                
    $values .= "'" mysql_real_escape_string $array [$keys [$index]] ) . "'";
            }
        }
        
        
    $query "INSERT INTO `" $table "` (" $columns ") VALUES (" $values ")";
        
        if ((
    $result mysql_query $query )) == 0)
            return (
    0);
            
    //echo '{"success":true,"data":"???????????? ?????"}';
        
        
    if (mysql_affected_rows () == 1)
            return (
    1);
            
    //echo '{"success":true,"data":"????????? ?????"}';
        
    else
            return (
    0);
            
    //echo '{"success":true,"data":"???????????? ?????"}';
    }
    echo 
    '{"success":true,"data":"???????????? ?????"}';
    ?>

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895

    Default

    I don't see a url declared in your submit...

  3. #3

    Default

    thank you

Similar Threads

  1. php is not responding.
    By nongkoogkai in forum Ext: Discussion
    Replies: 15
    Last Post: 16 May 2011, 2:46 AM
  2. Interface not responding
    By robando in forum Sencha Touch 1.x: Discussion
    Replies: 14
    Last Post: 7 Sep 2010, 11:04 AM
  3. responding to radiogroup events
    By stratton in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 6 May 2009, 5:30 AM
  4. Form not responding?
    By bubbless in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 22 Apr 2009, 10:01 AM
  5. event stop responding
    By qiang in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 24 Jul 2008, 11:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •