Blank Page after form completion
I have the most recent version of Zen Cart (installed it a few days ago) and I have no add ons
I *have* made changes to some core files (deleted the advanced_search.php due to restrictions by my webhost and edited the english.php file under /includes/languages/ for a few aesthetic things, but past that really nothing)
What's currently going on:
After the completion of any form on the site (register, log in, unsubscribe from newsletter, etc.) instead of returning to the home page or other relevant page, it displays a blank page and the browser asserts that it is done loading. If I manually return to the main site, the form is always completed successfully, it just fails to return you to a page which displays information.
I'm worried that this may extend to things like the shopping cart or checkout, but I haven't gotten to creating a product list, so there's no telling yet.
What could be causing this? Is there a sitewide function for redirect on completion/submission of a form? Does each .php file have it's own unique redirect code? What's going on here?
Halp!
Re: Blank Page after form completion
First thing I would check is that you haven't got any blank lines at the end of any files you have edited. Dreamweaver for example, is notorius for doing this (though I've never experienced it myself I have to say), but that's the usual cause of this happening.
Basically, check to see if there is any blank lines or spaces after the last '?>'
Re: Blank Page after form completion
http://www.zen-cart.com/index.php?ma...roducts_id=860
Install the above debugging tool from DrByte - the log file will be written to your cache folder and you can see what line the error is on - hopefully that helps.
Re: Blank Page after form completion
Ok I have found 3 separate issues with the debugging tool and I'm not 100% sure as to how to go about fixing them (not exactly a php wizard)
Quote:
[13-Apr-2010 08:21:30] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/content/a/d/m/admin420/html/includes/languages/english.php:1393) in /home/content/a/d/m/admin420/html/includes/init_includes/init_templates.php on line 78
[13-Apr-2010 08:21:30] PHP Warning: session_regenerate_id() [<a href='function.session-regenerate-id'>function.session-regenerate-id</a>]: Cannot regenerate session id - headers already sent in /home/content/a/d/m/admin420/html/includes/functions/sessions.php on line 167
[13-Apr-2010 08:21:30] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/content/a/d/m/admin420/html/includes/languages/english.php:1393) in /home/content/a/d/m/admin420/html/includes/functions/functions_general.php on line 44
for the code in question, here's the init_templates.php snippet
PHP Code:
/**
* send the content charset "now" so that all content is impacted by it
*/
(line 78) header("Content-Type: text/html; charset=" . CHARSET);
sessions.php
PHP Code:
function zen_session_recreate() {
global $http_domain, $https_domain, $current_domain;
if ($http_domain == $https_domain) {
$saveSession = $_SESSION;
$oldSessID = session_id();
(line 167) session_regenerate_id();
$newSessID = session_id();
session_id($oldSessID);
session_id($newSessID);
if (STORE_SESSIONS == 'db') {
session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}
session_start();
$_SESSION = $saveSession;
if (IS_ADMIN_FLAG !== true) {
whos_online_session_recreate($oldSessID, $newSessID);
}
} (there's an 'else' flag here, but the second half of the function is commented out)
and functions_general.php
PHP Code:
function zen_redirect($url) {
global $request_type;
// Are we loading an SSL page?
if ( (ENABLE_SSL == true) && ($request_type == 'SSL') ) {
// yes, but a NONSSL url was supplied
if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_CATALOG)) == HTTP_SERVER . DIR_WS_CATALOG) {
// So, change it to SSL, based on site's configuration for SSL
$url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_CATALOG));
}
}
// clean up URL before executing it
while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);
while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);
// header locates should not have the & in the address it breaks things
while (strstr($url, '&')) $url = str_replace('&', '&', $url);
(line 44) header('Location: ' . $url);
zen_exit();
}
Are there any glaring script errors in the areas mentioned? or is the problem more likely with the english.php page?
Re: Blank Page after form completion
Now that you've done that - check to make sure, like twaddle said, there aren't any blank lines at the ends of the:
/home/content/a/d/m/admin420/html/includes/languages/english.php
file.
If there's a
space below the following line at the end - put your cursor there and hit the backspace to remove it as this should be the very last thing written in the file.
?>