I am working on an email message which will be sent out once account access / status has been changed in my database. However, I cannot seem to get this simple IF statement below to work. I played around with the syntax by switching between AND and &&, but cant find the problem here.
$email_message = "
<h1>User Account Update</h1><hr>
User <b>".$_SESSION['myusername']."</b> has just made changes to the following user account:<br>
<br>
Date: ".date("Y-m-d H:i:s", strtotime('+13 hours'))." (UTC+8)<br>
User: ".$user."<br>
<b>Action: ".str_replace("_"," ",$action)."</b><br>
<br>
Updated Access: ".if($action == "change_access" AND $access == "User") { echo "Admin"; } else { echo "User"; }."<br>
Updated Status: ".if($action == "change_status" AND $status == "Active") { echo "Inactive"; } else { echo "Active"; }."<br>
<hr>
If you suspect suspicious activity, you can suspend the account by following the link below:
";
Is there any special syntax when the if statement happens in a string?
Aucun commentaire:
Enregistrer un commentaire