Note that there are some explanatory texts on larger screens.

plurals
  1. POmake an ifnot statement and if statement in one line
    primarykey
    data
    text
    <p>I'm trying to make an if statement with 2 conditions. One that checks if one variable is NOT present &amp; does NOT matches the word "good2go" and the other that checks to make sure "body" variable is present. I'm trying to trip the error message here. Here is what I have and what I've tried, and none of it seems to work.</p> <pre><code>if (stripos($_POST['check'], 'good2go') == FALSE &amp;&amp; $_POST['body']) { $error = true; } if (!$_POST['check'] == 'good2go' &amp;&amp; $_POST['body']) { $error = true; } if (!stripos($_POST['check'], 'good2go') &amp;&amp; $_POST['body']) { $error = true; } if ((!stripos($_POST['check'], 'good2go')) &amp;&amp; $_POST['body']) { $error = true; } </code></pre> <p>How do I get this to work?</p> <p>here's the entire code of contact_us.php this has the validation code and the email code.</p> <pre><code> $error = false; if (isset($_GET['action']) &amp;&amp; ($_GET['action'] == 'send')) { // Winnie the pooh check //$t = tep_db_prepare_input($_POST['verify']); if (!isset($_POST['check']) &amp;&amp; !$_POST['check']=='good2go' &amp;&amp; isset($_POST['body'])) { $error = true; } else { // Winnie the pooh Check $name = tep_db_prepare_input($_POST['name']); $email_address = tep_db_prepare_input($_POST['email']); //IP recorder start $ipaddress = $_SERVER["REMOTE_ADDR"]; $ip = "\n\nIP: " . $ipaddress; $content = "\n\nName: ".$name."\n\nComments: ".$_POST['enquiry']; $product = tep_db_prepare_input($_POST['product']); if ($product) { $product_text = "\n\nProduct Interest: ".$product; } $content_ip = $content . $product_text. $ip; $enquiry = tep_db_prepare_input($content_ip); //IP recorder end } // BOF: Remove blank emails // if (tep_validate_email($email_address)) { // tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address); // tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success')); // } else { // $error = true; // $messageStack-&gt;add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); if (! tep_validate_email($email_address)) { $error = true; $messageStack-&gt;add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } if ($enquiry == '') { $error = true; $messageStack-&gt;add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR); } if ($error == false) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address); tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success')); // EOF: Remove blank emails } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload