I'm trying to create a custom module which will display a message after my webform. I know that in order to display a message, I could use the following code:
$message = "Message here";
drupal_set_message(t($message));
But rather than having a specific message, I want to have a conditional message based on PHP if statements. E.g.,
if($class == A) {
print "Correct!";
}
So, my question is how can I get the results of this PHP code to display on my webform? I'm not familiar with PHP code, so I don't know if I can combine the $message code with the if statement somehow. (I've tried variations of this with no success.)
Thanks for your help.
t()
function is to use a place holder. Ex:drupal_set_message(t(@message', array('@message' => $message)));
For more info on how to properly use thet()
function, see DRUPAL CODE STANDARDS: THE T() FUNCTIONwhich will display a message after my webform
Are you referring to after the webform is submitted? or do you reefer to literally after (below) the webform?