Jump to content

Added register_long_arrays = On on php5.ini and now online forms won't send email


ArtbyPatrick

Recommended Posts

then maybe the error is from the form itself as it is not sending an email to the admin nor a confirmation email to the user.

 

But after looking at the code itself, it seems that I have everything entered correctly, but again I am no expert at php. Here is the code from the contact page that I believe is responsible to send the email:

require('includes/application_top.php');  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);    $error = false;  if (isset($_GET['action']) && ($_GET['action'] == 'send')) {    $name = tep_db_prepare_input($_POST['name']);    $email_address = tep_db_prepare_input($_POST['email']);    $enquiry = tep_db_prepare_input($_POST['enquiry']);    if (tep_validate_email($email_address)) {      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);    //  tep_mail("info@itnexus.ca", "info@itnexus.ca", EMAIL_SUBJECT, $enquiry, $name, $email_address);      tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));    } else {      $error = true;      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);    }  }

Is this the correct way ?

 

Thanks for all of your help

Link to comment
Share on other sites

That looks fine, but it's using all custom functions. It's also checking if $_GET['action'] is set to "send", so the form tag needs to look something like this, with the action attribute:

 

<form action="send_mail.php?action=send" ...

 

If the action URL doesn't have that "?action=send" in the end of it, then that check won't pass and nothing will be sent.

Link to comment
Share on other sites

yes here is what I found in the code as action:

<td width="100%" valign="top"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

so I believe, if I am not mistaking, this counts as the <form action="action=send"> Am I right?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...