Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2008
    Posts
    24
    Plugin Contributions
    0

    Default mysterious header_php.php malfunction

    Please forgive the length of this complicated and frustrating story, but I don't want to leave out what might turn out to be the key detail.

    I installed Zen Cart 1.3.8a a couple of weeks ago and have been busy building a test site alongside my existing website ever since. I didn't have any prior experience with php, but I seem to have managed to teach myself just enough to get in trouble.

    I wanted Zen Cart to bypass the checkout_shipping page, because that page really wasn't doing anything useful, given my particular shipping option configuration. The only way I could see to do it was to hack includes/modules/pages/checkout_shipping/header_php.php. I managed to get my hack to work, but several days later I made some mysterious mistake somewhere else in the checkout process, resulting in a white screen. In order to figure out what was going on with that, I removed all my overrides so I could put them back one by one and try to determine where the fault lay. I also removed my hacked header_php.php file and restored the default for it. Removing the overide files solved the white screen problem, but by some bizarre persistence of memory Zen Cart continued to bypass the checkout_shipping page after the default header_php.php was restored. I ran into other problems, too, and ultimately could see no option but to reinstall Zen Cart, which I did.

    After reinstallation, I uploaded my override files one by one and got them to work, but now the hacked header_php.php caused a white screen. When I restored the default, however, the white screen would still appear -- until I disconnected from the internet, turned off my computer, turned it back on, and logged back online. Then my website would execute the default instead of the hack. Worse yet, I discovered that making any hack at all to the default, even just deleting text from a commented line, would now cause the white screen. This had not happened before and was completely incomprehensible to me.

    It seemed as though somehow the simple process of saving the edited file might be messing it up somehow, so I replaced the poorly regarded Notepad with Notepad++. That didn't help.

    Thinking about it, I have realized that there is another anomaly. When Zen Cart leaves the shopping cart page, it goes first to the checkout_shipping page, where the header redirects it to the log_in page if the user isn't logged in. That still works with a modified header_php.php, but when it tries to go from log_in to checkout_shipping, the screen goes white. Again, it does this even if the only modification is to change a line of comments. And, it only sees the restored default after I turn off my computer and turn it back on.

    Any ideas as to what on earth is going on here?

    My webhost was using php version 4.4.8, but offered the option of upgrading to version 5. I upgraded. No help. The version of MySql is 5.0.45-community. The server is running Linux, kernel version 2.6.9-55.0.2.ELsmp.

    Many thanks!

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: mysterious header_php.php malfunction

    Some of this is your browser cache - as when you disconnected etc you then saw what you should have. Clear your browser cache when doing changes to insure that you see your changes correctly.

    Might restore to default and look in the downloads section for 3rd party modules for streamlining the checkout process - I think that there is one called "one page checkout" or similar - you might find one that does what you want
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: mysterious header_php.php malfunction

    kobra:

    That's good advice concerning looking for a third-party module. Thanks!

    I'm still intellectually curious about the question of what was going wrong, though. Why should any innocuous change, such as one to a comment line, make the file unexecutable? It wasn't doing that before!

    With regard to the browser cache, your remarks make sense, except that in the past, every change I made happened immediately. I didn't need to clear the cache to get rid of each default I was replacing before, or to undo my changes by restoring the defaults, either. For that matter, when I have the default working now, and then go and change it, the white screen happens immediately. The browser cache isn't holding onto the default in that case. Puzzling.

    Thanks again for your prompt and helpful response!

  4. #4
    Join Date
    Jul 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: mysterious header_php.php malfunction

    Further concerning the browser cache idea: one of the reasons I found the behavior puzzling was that while it looked like a browser cache issue, that explanation didn't fit in with my limited understanding of php. I thought php was executing all these various files on the server and then downloading html code to me. If there is a change to one of the component .php pages, why would that show up in my browser cache? Why wouldn't the change be dutifully implemented by the server, far far away, as it compiled the various php files into html?

    For that matter, when I look in my browser cache, the only files there from my website are ones suffixed .gif, .js, and .css, i.e., clearly not the ones causing the problem. Moreover, that suggests the browser is not actually caching the html code the server is feeding it, but implementing it on the fly and moving on.

    Sorry to betray so much ignorance of the way the internet works, but I am interested to learn.

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: mysterious header_php.php malfunction

    Sorry to betray so much ignorance of the way the internet works, but I am interested to learn.
    While you are correct about what happens server side this is browser dependant and fully on the user end...

    I have had stranger things happen on one platform
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. v150 questions about code - header_php.php & main_template_vars.php
    By barricades in forum General Questions
    Replies: 3
    Last Post: 8 May 2012, 06:44 AM
  2. accept.php malfunction
    By smokers-heaven in forum Addon Payment Modules
    Replies: 0
    Last Post: 10 Mar 2008, 09:13 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
  •  
disjunctive-egg