PDA

View Full Version : show ipaddress


mrkhm
06-23-2008, 04:24 AM
Hi,

how do i display the user ip address or guest ip address in the forum pages e.g. your ipaddress is xxx.xxx.xxx

I dont know whether this can be done via plugin/hook? but i really need it.

i have tried the usual:

$_SERVER['REMOTE_ADDR']

but when i try to save my template page i get a parse error.

i would also like to be able to add this ip info as a hidden custom field in my payment buttons, but this button is also available to unregistered guests so it is not necessarily a memberinfo(ipaddress) function i am after but rather currentbrowser(ipaddress). please anyone?

thanks

Dismounted
06-23-2008, 06:25 AM
Use the constant: IPADDRESS.

mrkhm
06-23-2008, 07:13 AM
hi dismounted, well when i try:

<input type="hidden" name="custom" value="IPADDRESS">

when you view the source code all i see is the word IPADDRESS and just in case i also tried

<input type="hidden" name="custom" value="$IPADDRESS">

but then all i see is blank i.e. ""

Dismounted
06-23-2008, 07:27 AM
It is a constant - you cannot use these directly in templates. You will have to assign a variable to the constant.
$ipaddress = IPADDRESS;