php - Place a default email address in when a custom form field is left blank -
i want place default email address in when custom form field left blank. can't code right. use email address in place of real email address.
<?php if(get_field('cemail')) { ?> <?php $email = (get_field('cemail')); if($email!=""){ echo 'email address' ; } ?>
you can like;
<?php $email = $_get["email"]; if($email=="" || !filter_var($email, filter_validate_email) === false) $email = "default_email@email.com"; echo $email; ?>
Comments
Post a Comment