Page 4 of 4 FirstFirst ... 234
Results 31 to 39 of 39
  1. #31
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default Re: Can't include catalog functions in seperate PHP file.

    OK I will use this function to extract error details.

  2. #32
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default Re: Can't include catalog functions in seperate PHP file.

    I have used the following line of code:
    ini_set("display_errors","2");
    ERROR_REPORTING(E_ALL);

    in my root folder PHP file when this file is access from EZ pages using AJAX call I don't see any error but AJAX does not work.

    The EZ Pages block all PHP errors.

    What should I do now?

  3. #33
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Can't include catalog functions in seperate PHP file.

    Where are you looking for the errors? How do you know that the AJAX hasn't worked? Which step in the AJAX process isn't working?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #34
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default Re: Can't include catalog functions in seperate PHP file.

    I'm using Jquery for AJAX call.

    The Success function or any other function like Error or Complete does not execute once I send the AJAX Call.

    I'm using json_encode to get everything back on EZ pages on Zen cart. After including Application_top.php file nothing comes back through JSON_ENCODE, rather i receive 0 bytes.

  5. #35
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Can't include catalog functions in seperate PHP file.

    All you're telling us is that you're not getting a response after triggering an ajax message. But you telling us anything about what steps you've taken to work out whether it's a problem with sending your message, or with receiving it on the server, or with handling the message or with preparing the response or with sending the response.

    You do suggest that you're using json_encode to send the response, but that's not what json_encode does. It's function is merely to take a value (usually an array for AJAX) in UTF-8 format and return a string in json format. It doesn't send it anywhere.

    The situation you find yourself in is normal when developing ajax, since by definition, much of the processing is hidden away. I find the Firebug console feature invaluable for exposing the messages to and from the server.

    Errors on the server can be seen in your site's or your apache log files, and if they're not reported there, insert some dumps of your own and write them to your own log files (or echo or var_dump trace information and pick it up in the ajax response shown in the Firebug console).

    However, the only person who can do all this is you, as it requires access to your server, and possibly your admin (though your later posts suggest that you're doing something on your EZ-Pages rather than in your admin, so maybe not), and specific knowledge of the code you're writing.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #36
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default Re: Can't include catalog functions in seperate PHP file.

    Thank you so much for your detailed response. I will try to track the error and will inform you where the exact problem is.

    Previously, I had enabled PHP reporting but no error was detected when AJAX stopped working after including application_top.php file.

    I think Firebug is the right option at this time to track what the exact problem is?

    I know you cant test what I'm trying to do but if you want I can paste the code here. Let me know if by pasting code here can give you better understanding of how I'm implementing AJAX. ?

  7. #37
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default Re: Can't include catalog functions in seperate PHP file.

    Thank you so much for all your effort.

    BUT I HAVE JUST GIVEN UP !

    I have tried everything but i don't know why php file is not sending response back to JS file when I include application_top.php file.

  8. #38
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default Re: Can't include catalog functions in seperate PHP file.

    I have given one more attempt to this issue. The following code is tested:

    myphp.php file:
    <?php
    echo 'Testing module';

    require('../includes/application_top.php');

    echo 'Code after Application_top.php';
    ?>

    When I call this myphp.php file through AJAX I get only "Testing module" printed but no other message after application_top.php file is executed.
    It shows that when require('../includes/application_top.php'); is executed it redirects somewhere else without giving any error therefore nothing after that line is executed. That is why I'm not getting any response from AJAX as soon as I include application_top.php file.

    I hope now you can realize that there are some settings or some variables in application_top.phph which does not allow further execution of my php file.

    Can you suggest any solution now?

  9. #39
    Join Date
    Oct 2015
    Posts
    5
    Plugin Contributions
    0

    Default Re: Can't include catalog functions in seperate PHP file.

    this is late I'm sure but this was my solution. I needed to add the chdir. With out that no matter if I put the full path or not it would not work

    chdir('../../');
    require_once('includes/application_top.php');

 

 
Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. separate php file inside catalog can't connect to database
    By caborela in forum General Questions
    Replies: 1
    Last Post: 3 Mar 2012, 09:11 AM
  2. 'include' php file
    By vandiermen in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Sep 2011, 05:41 PM
  3. Include a custom php file in mainpage.php
    By BeautyHealth.com.cy in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 8 Nov 2010, 02:45 PM
  4. How can I include a php file in the header section?
    By Andy_R in forum General Questions
    Replies: 3
    Last Post: 11 Sep 2009, 05:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR