I came across this post: execute a php code after a user login and I implemented the accepted solution. In my implementation, however, I'm trying to output content to the page. This simply doesn't show up. My module name is "alert", and here's the code:
alert.module
<?php
function alert_user_login(&$edit, $account) {
for ($i=0; $i < 1000; $i++) {
echo 'hi<br>';
}
}
alert.install
<?php
function alert_install() {
// Set the module weight so it can override other modules.
db_query("UPDATE {system} SET weight = 99 WHERE name = 'alert'");
}
function alert_uninstall() {
// Remove the module from the system table
db_query("DELETE FROM {system} WHERE name = 'alert'");
}
alert.info
; $Id$
name = Alert
description = Present dialogs or perform redirects based on certain events
core = 7.x
I'm implementing this in my theme's template.php
file. Should this work?