Forums / Installing on a Linux/Unix Server / blank page & no emails after user registration and order confirmation

blank page & no emails after user registration and order confirmation

Locked

Views: 10,376

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
20 Jun 2006, 4:06 PM
#1
wwinfrey avatar

wwinfrey

New Zenner

Join Date:
Apr 2006
Posts:
2
Plugin Contributions:
0

blank page & no emails after user registration and order confirmation

I've got a new ZenCart unix installation, and everything is working smoothly. except for two things:

  1. When the user gets to the final stage of either the registration process or the ordering process, the final page returned is blank, and,

  2. No emails are sent out to either the admin or the user.

I'm not exactly sure, but I think what's happening is that, because the email is unable to go out, the final page isn't rendering.

I took at look at htdocs/includes/modules/checkout_process.php, and the final two steps are:

// store the product info to the order
$order->create_add_products($insert_id);
$_SESSION['order_number_created'] = $insert_id;
$zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS');

This happens. The order shows up in the administrative interface. However, when the following chunk of code is executed:

//send email notifications
$order->send_order_email($insert_id, 2);
$zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL');

It doesn't seem to happen. After poking around in the code, I can see that zco_notifier is an instantiation of a notifier object, but I can't really tell what it's doing. If I had to guess, I'd guess that it was telling the checkout process to send an email confirmation and return a confirmation page to the user, but because it's failing (maybe on the email), neither is happening. Does this sound plausible ?

Now, if I look at htdocs/includes/modules/create_account.php, I can see how the process succeeds until it gets to the end:

    // send welcome email
    zen_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_NAME, EMAIL_FROM, $html_msg, 'welcome');

which doesn't happen, as well as

    zen_redirect(zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

Which also doesn't seem to happen. Is there supposed to be a value in the second argument position, before 'SSL' ?

Other than these problems (which are keeping our site from launching), everything else has been pretty smooth.

If anyone has any ideas as to what's going on here, I'd be most grateful to hear them.

20 Jun 2006, 4:36 PM
#2
wwinfrey avatar

wwinfrey

New Zenner

Join Date:
Apr 2006
Posts:
2
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

I should add that I get the same behavior with the contact us page -- after filling out the form fields and hitting the "send now" button, I get a blank page and no emails.

Also, because I know someone will want to know:

PHP Version: 5.1.2
Zend Version: 2.1.0
OS: Fedora Core 4
Email Method: /usr/sbin/sendmail

20 Jun 2006, 6:55 PM
#3
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: blank page & no emails after user registration and order confirmation

zen_redirect(zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

For this one, it happends to me sometimes as well but I found an alternative way to prevent the error for this case.

change the quote above to read as:

$redirect = "<meta http-equiv=\"refresh\" content=\"0; url=".zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, "", "SSL")."\">";
echo $redirect;
unset ($redirect);

This should do the trick for redirection. :thumbsup:

21 Jun 2006, 2:08 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: blank page & no emails after user registration and order confirmation

Check to be sure that the:

/includes/languages/english/html_includes

directory and all subdirectories and files are set to 777 ...

There are new ones, see if that makes a difference ...

If not, reload the files to:

/includes/pages/checkout_success

/includes/templates/template_default/tpl_checkout_success_default.php

/includes/languages/english/checkout_success.php

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Jun 2006, 2:09 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: blank page & no emails after user registration and order confirmation

Also have you an URL to you site that we can peek at?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Jun 2006, 3:36 PM
#6
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

This may be relevant, but it may not. A little time ago and exploit was found in the osCommerce contact_us form which allowed it to be hijacked to send out spam. Once hosting companies caught on to this exploit (their servers were getting blacklisted by SpamCop, SpamHaus etc) they blocked the email facilities for that programme and people were getting blank contact_us pages. Check with your hosting company to see if they have done something similar which is affecting Zen Cart.

They may have put security filters in place which prevent Bulk Mailers from operating.

Vger

29 Oct 2007, 1:14 AM
#7
renaissanceart avatar

renaissanceart

New Zenner

Join Date:
Oct 2007
Posts:
65
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

TheOracle:

For this one, it happends to me sometimes as well but I found an alternative way to prevent the error for this case.

change the quote above to read as:

$redirect = "<meta http-equiv="refresh" content="0; url=".zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, "", "SSL")."">";
echo $redirect;
unset ($redirect);

> 
> This should do the trick for redirection. :thumbsup:

That just saved my ###### :clap::thumbsup:
7 Feb 2009, 6:57 PM
#8
angelicabb avatar

angelicabb

New Zenner

Join Date:
Jul 2007
Posts:
1
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

Although you can edit the file directly, I preferred to create a copy. Here is how I solved this error.

  1. Create a folder under your custom template as follows:
    includes/templates/MYTEMPLATE/templates
  2. Copy the file tpl_contact_us_default.php from includes/templates/template_default/templates into the folder created in the step above.
  3. Open the copy of tpl_contact_us_default.php from your custom templates folder.
  4. Modify this line:
<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

and replace it for:

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=success')); ?>
  1. Save the file and upload to your server.
    It worked for me. I'm using Zen Cart V. 1.3.8a/1.3.8
    :clap:
19 Feb 2009, 5:47 AM
#9
neekfenwick avatar

neekfenwick

New Zenner

Join Date:
Feb 2009
Posts:
101
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

Please excuse me for jumping in here.. I'm also having trouble with zen_redirect() not working, perhaps it's related to this thread.

Some versions: I've a fairly fresh install of Zen Cart v1.3.8a/v1.3.8 on Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8b DAV/2 PHP/5.2.6 on linux, PHP 5.2.6 (Zend: 2.2.0). I'm calling my local dev system using Firefox 3.0.6.

The first time I've tried logging in as a new customer, I'm taken through the tpl_login_default.php page, fill in the login information for a new customer, and click Submit. The 'create_account' logic is triggered. I've disabled emails using SEND_EMAILS=false. I've traced it through the login process all the way to the final call of:

zen_redirect(zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

This successfully gets to the line in functions_general.php:

header('Location: ' . $url);

The result is a blank page with no html source (actually FireBug shows "<html><head></head><body/></html>" but I think that's a red herring).

$url is "http://<obscured>/index.php?main_page=create_account_success&zenid=fffc29cedacc1bf4a18195af3c9f7da3", and if I paste that into my Address bar it does bring up the success page.

If I test with headers_sent() before the call to header(), it proves the headers have already been sent .. but header() is being called from include/modules/create_account.php.

I understand the redirect trick given above, but surely we shouldn't need to resort to such hacky methods, when redirect() ought to work??

I've checked for any "echo" output I might have left in, that would cause the server to send headers before it reaches the 'header()' call, but can't see anything. How can I find what is causing headers to be sent before it reaches this zen_redirect() call in the create_account.php module?

Advice much appreciated :) Nick

19 Feb 2009, 7:20 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,514
Plugin Contributions:
176

Re: blank page & no emails after user registration and order confirmation

You'll be a lot further ahead using the debug utility mentioned in this FAQ dealing with troubleshooting blank page problems: https://www.zen-cart.com/tutorials/index.php?article=82

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Feb 2009, 8:41 AM
#11
neekfenwick avatar

neekfenwick

New Zenner

Join Date:
Feb 2009
Posts:
101
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

:D Thanks for the tip, I hadn't seen that debug script before. I had to set my cache dir to writable by all (my httpd runs as user 'daemon') and suddenly I got files e.g myDEBUG-1235032180.log which proclaimed:

[19-Feb-2009 15:29:40] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /opt/zen-cart/zen-cart-DEV/includes/extra_datafiles/extra_description_type_databese_names.php:24) in /opt/zen-cart/zen-cart-DEV/includes/functions/sessions.php on line 108

And indeed, the scuzzy extra_description product mod I had downloaded had about 4 extra carriage returns after the final "?>". I removed the offending lines from extra_description_type_databese_names.php and suddenly my redirect() call works.

Big hugs for you :hug: big foot through the screen for the extra_description author :lamo: :smile:

4 Apr 2009, 1:53 PM
#12
digitechstop avatar

digitechstop

New Zenner

Join Date:
Oct 2006
Posts:
6
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

I just switched servers and tracked down a blank page problem to zen_redirect. I solved it by directly modifying the zen_redirect function as per the solution proposed by renaissanceart. replacing

header('Location: ' . $url);
``` with

$redirect = "<meta http-equiv="refresh" content="0; url=".$url."">";
echo $redirect;
unset ($redirect);
on the last line of the zen_redirect function. This takes care of the problem when the server does not want to perform the
header('Location: 'url')

4 Apr 2009, 10:22 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,514
Plugin Contributions:
176

Re: blank page & no emails after user registration and order confirmation

Keep in mind that doing redirects in that manner is not friendly for search engines. So, only do it if you don't care about how search engines treat your site.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Apr 2009, 7:25 PM
#14
digitechstop avatar

digitechstop

New Zenner

Join Date:
Oct 2006
Posts:
6
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

Actually, I DO care how search engines feel about my site. Do you have any alternate suggestions for redirection when Location: will not function?

5 Apr 2009, 7:34 PM
#15
digitechstop avatar

digitechstop

New Zenner

Join Date:
Oct 2006
Posts:
6
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

Actually, I DO care how search engines feel about my site. Do you have any alternate suggestions for redirection when Location: will not function? I've just put the header('Location: ' . $url); back in before the```
$redirect = "<meta http-equiv="refresh" content="0; url=".$url."">";
echo $redirect;
unset ($redirect);



I'm hoping the search engine will redirect with the Location: command and my guests can take advantage of the meta redirect once the Location: command has failed. Your thoughts?
5 Apr 2009, 8:08 PM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,514
Plugin Contributions:
176

Re: blank page & no emails after user registration and order confirmation

digitechstop:

Do you have any alternate suggestions for redirection when Location: will not function?
The most common reason for a Location: redirect to fail would be other errors occurring in the script, especially something that's throwing a "headers already sent" condition.
The easiest way to identify such problems is to use the debug logging utility I talked about earlier in this thread, quoted again here:
DrByte:

You'll be a lot further ahead using the debug utility mentioned in this FAQ dealing with troubleshooting blank page problems: https://www.zen-cart.com/tutorials/index.php?article=82

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Apr 2009, 6:11 PM
#17
b3asker avatar

b3asker

New Zenner

Join Date:
Apr 2009
Location:
Sunny, Florida
Posts:
4
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

:clap: Couldn't agree more with this reply here! :yes:

I ran the Debugger and it told me page and lines to fix. Sweet! :lamo:

DrByte:

You'll be a lot further ahead using the debug utility mentioned in this FAQ dealing with troubleshooting blank page problems: https://www.zen-cart.com/tutorials/index.php?article=82

30 Jul 2009, 10:38 AM
#18
ticklefish1 avatar

ticklefish1

New Zenner

Join Date:
Mar 2009
Posts:
12
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

I'd just like to thank you for the link to the debugging download which in turn sent me to THIS tutorial, which FIXED THE PROBLEM!!!!

Turned out to be a couple of blank lines at the very end of the file /includes/languages/english.php ... once those 2 or 3 blank lines were deleted, the blank page problem was fixed!!

THANK YOU THANK YOU THANK YOU!!! :clap:

18 Dec 2009, 11:03 PM
#19
netgirlz avatar

netgirlz

New Zenner

Join Date:
Aug 2009
Posts:
34
Plugin Contributions:
0

Re: blank page & no emails after user registration and order confirmation

is it possible to leave the debug script activated, as we have errors which are happening rather rarely (once every couple wks), people registering and getting blank pages, people paying and being presented with a blank page instead of the return url ...

if it left activated will it slow the site down too much

any other consequences of leaving it activated until we get the errors
or will it log too much material to be of any use

18 Dec 2009, 11:24 PM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,514
Plugin Contributions:
176

Re: blank page & no emails after user registration and order confirmation

It's safe to leave it on.
Whether it creates too many files or not depends entirely on how many errors are happening on a consistent basis.
So, as long as you leave it there, be sure to check the logs daily.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.