Jump to content

[SOLVED] IF ELSE to say something other than TRUE


psquillace

Recommended Posts

Hello All:

 

Currently on a site I have a checkbox for people to check to opt-in to ok to send them emails if checked with

 

// Check for Opt-In.

if (!isset($_POST['optin']) && ((empty($_POST['email'])) || !valid_string($_POST['email']))) {

$optin = FALSE;

$email = FALSE;

$canspam = TRUE;

} else {

if (isset($_POST['optin']) && (!empty($_POST['email']))) {

if (check_email_address($_POST['email']) && ($_POST['optin'] == 'TRUE')) {

$optin = $_POST['optin'];

$email = $_POST['email'];

$canspam = TRUE;

} else {

$message .= 'To receive emails, you need to check the box and provide a valid email address!<br>';

}

} else {

$message .= 'To receive emails, you need to check the box and provide a valid email address!<br>';

}

}

 

 

However, I would like it to say NO when someone does not check the box.

 

How would I add that in here?

 

 

thanks for any advice,

 

Paul

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.