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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.