I am trying to pass a value from a form to a php file which uses an if - else statement based on input, but it always returns a value of false (even when it should be true). The beginning of the document that contains the form has the following info:
<?php
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWSLETTERS);
$newsletter_email=$HTTP_GET_VARS['email'];
?>
The php form is as follows:
<form NAME="newsletter" ACTION="<? echo tep_href_link(FILENAME_NEWSLETTERS_PROCESS, '', 'NONSSL'); ?>" METHOD="post" onSubmit="return verify(this);">
<input type="hidden" name="submitted" value="true">
<? echo TEXT_EMAIL; ?> <input type="text" name="Email" value="" size="25" maxlength="50"><br>
<? echo TEXT_FIRST_NAME; ?> <input type="text" name="firstname" value="" size="25" maxlength="50"><br>
<? echo TEXT_LAST_NAME; ?> <input type="text" name="lastname" value="" size="25" maxlength="50"><br>
<?php echo tep_image_submit('button_submit.gif', IMAGE_BUTTON_SUBMIT); ?>
</form>
No errors are being generated, it just is not pulling the variable entered. The FILENAME_NEWSLETTERS_PROCESS document is as follows:
<?php
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWSLETTERS);
$newsletter_email=$HTTP_GET_VARS['email'];
$cus_newsletter_raw = "SELECT 0 FROM customers WHERE customers_newsletter = '0' AND customers_email_address = '" . $newsletter_email . "'";
$cus_newsletter_query = tep_db_query($cus_newsletter_raw);
$cus_newsletter = tep_db_fetch_array($cus_newsletter_query);
if ($cus_newsletter) {
tep_db_query("UPDATE customers SET customers_newsletter = '1' WHERE customers_email_address = '" .$newsletter_email . "'");
?>
Email Address Found!
<?php
} else {
?>
No Email Address Found
<?php
}
?>
No matter what I enter it always returns the else, even when it should return the if.