10

how can I show users success/error messages without creating a node for it?

Thanks in advance!

n00b
  • 14,958
  • 19
  • 52
  • 71
  • Need clarifications. Node is not used for printing error messages. Usually it showed via drupal_set_message('message', $status); – Nikit Mar 19 '10 at 10:13

3 Answers3

19

drupal_set_message($msg, $type = 'status'); lets you set a message, it will be displayed automatically on the next (or current) page the user visits.

The optional second argument lets you choose between an informational message (status), a warning (usually yellow) or an error (red).

See the docs: http://api.drupal.org/api/function/drupal_set_message/6

Wim
  • 10,455
  • 37
  • 55
0

Not really too sure what your question is, in your theme, there will be the variable

<?php
    print $messages;
?>

This will print any success/error messages to the screen. They are not stored as nodes.

For a complete list of drupal variables see the documentation

wiifm
  • 3,698
  • 1
  • 19
  • 22
  • Any ideas on best ways to get these messages from within the node template? – Ain Tohvri Oct 05 '12 at 00:45
  • 1
    I tried 2 modules, Inline Messages http://drupal.org/project/inline_messages and Inline Form Errors http://drupal.org/project/ife, ended up using the latter and submitted a patch for both modules. Delivers nicely. – Ain Tohvri Oct 07 '12 at 12:45
0

Use this code in settings.php to disable the error messages:

$conf['error_level'] = 0;

See this blog: from here

Anurag Dabas
  • 7,118
  • 4
  • 9
  • 28