How to show IP address of user when login to Drupal website in footer or any region of theme? Is there any module or tricks. Please let me know. Thanks.

Comments

grendzy’s picture

$_SERVER['REMOTE_ADDR'] contains the IP address. You could put this in your page template file (page.tpl.php), or in a block.

Yuki’s picture

Thanks

David Naian’s picture

This did not work for Drupal 5. Could you please add the code for Drupal 5? Thanks

edit: I found it myself ;-)

<?php
$ip = getenv("REMOTE_ADDR");
 
print $ip;
?>
tracerul’s picture

<?php
print ('Your IP is: '.$_SERVER['REMOTE_ADDR']);
?>

Input format must be php code.

popzkg’s picture