Page 4 of 4 FirstFirst ... 234
Results 31 to 38 of 38

Thread: Alternative Ext Direct PHP Implementation

  1. #31

    Default

    Then i created a add form and trying to insert record. Add form posted above
    Please help me soon...........
    Please reply me soon.. Please.........................
    Please...................

  2. #32

    Default

    Hi, I am waiting for your reply. please help me...

  3. #33
    Sencha User
    Join Date
    Apr 2008
    Location
    Germany
    Posts
    24

    Default

    Hello Thommy,
    I'm using your direct php package in version 1.01 and I'm very enthusiastic.

    I found an improvement: to use server functions with optional parameters make the following changes:

    File 'API.php' about line 161:
    Code:
                                $method = array(
                                    'name' => $rMethod->getName(),
                                    'len' => $rMethod->getNumberOfParameters(),
                                    'req' => $rMethod->getNumberOfRequiredParameters()
                                );
    File 'Router.php' about line 162:
    Code:
                    if(count($params) < $mconf['req']) {
                        throw new Exception("Not enough required params specified for method: $method on class $class");
                    }
    And I have a question: In Router.php starting with line 109 there is an else block: For what purposes is this block? It seems it does nearly the same as the corresponding code in API.php.

    Greetings,
    Wolfgang Mattis

  4. #34
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Sarnia, ON, Canada
    Posts
    62

    Default File Upload Problem

    Sorry I don't have much time to investigate whether this is my problem (since I have modified your implementation over time) or if this is a problem in the original code base; however, I just wanted to make this known to anyone (even using any other framework) who might be having problems with file uploads using Direct.

    My problem was that for some reason I was able to post a form including files to the formHandler method; however, for some reason my success and failure callbacks would never get called even though the response was definitely correct. It turns out that the response wasn't correct though, the problem being that a response Content-Type header of text/javascript was being returned for file-uploads. The BasicForm handler doesn't like it when the wrong content type is returned to the iframe and the success, failure, waitMsg, etc. callbacks are never called. The fix I used was modifying your _print method to force the Content-Type to be text/html when it's a file-upload:

    Code:
            private function _print($response) {
                if(!$this->isForm) {
                    header('Content-Type: text/javascript');                
                }
                else if($this->isUpload)
                {
                    header('Content-Type: text/html');    
                }
        
                echo $response;
            }
    Hope this helps someone!

    Cheers,
    Milan

  5. #35
    Sencha User
    Join Date
    Jul 2011
    Posts
    6

    Default php extjs4.0 integration

    I downloaded the file and unpacked it in my html directory. When I run a sample html page with included api.php it, the developer web inspector window is telling me that Ext.ss.Echo.send is undefined. What am i doing wrong?

  6. #36
    Sencha Premium Member
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    53

    Exclamation Noticed a bug

    Hi there,

    I noticed a bug where the autoInclude option was ignored by the Router.php class.

    This patch fixes this!Router.patch.txt

    Regards,

    Tim

  7. #37
    Sencha User
    Join Date
    Aug 2011
    Posts
    5

    Default

    thank you, [email protected]! it was very much of help!

  8. #38
    Sencha User
    Join Date
    Feb 2010
    Location
    Figueres (Spain)
    Posts
    370

    Default sanitize $_POST ?

    Hello, i'm not an expert in security programming in php, and so, i want to ask if anyone knows is in this piece of code, the $_POST values received, must be passed to a sanitize function (or something like that), or working like this is almost secure.

    Thanks.

    Code:
            public function parseRequest() {
                if(isset($GLOBALS['HTTP_RAW_POST_DATA'])){
                    $this->data = json_decode($GLOBALS['HTTP_RAW_POST_DATA']);
                }
                else if(isset($_POST['extAction'])){ // form post
                    $this->isForm = true;
                    $this->isUpload = $_POST['extUpload'] == 'true';
                    
                    $data = new BogusAction();
                    $data->action = $_POST['extAction'];
                    $data->method = $_POST['extMethod'];
                    $data->tid = $_POST['extTID'];
                    $data->data = array($_POST, $_FILES);
                    
                    $this->data = $data;
                }
                else {
                    die('Invalid request.');
                }
            }
    -------------------
    Manel Juarez

Page 4 of 4 FirstFirst ... 234

Posting Permissions

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