Re: {php} don't work

From: Date: Mon, 24 Sep 2001 22:16:32 +0000
Subject: Re: {php} don't work
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1535@lists.php.net to get a copy of this message
global values are not available from within a php function. try this: {php} global $HTTP_SERVER_VARS, REMOTE_ADDR; echo "welcome from ".$HTTP_SERVER_VARS["REMOTE_ADDR"]; echo "<br>or from.. ".$REMOTE_ADDR; {/php} Pablo Veliz wrote: > > I want to show in every page the client IP so I have put this on every template: > {php} > echo "welcome from ".$HTTP_SERVER_VARS["REMOTE_ADDR"]; > echo "<br>or from.. ".$REMOTE_ADDR; > {/php} > > but I only get: > welcome from > or from.. > > but when I run on a x.php file like: > <? > echo "welcome from ".$HTTP_SERVER_VARS["REMOTE_ADDR"]; > echo "<br>or from.. ".$REMOTE_ADDR; > ?> > > I get a correct response: > welcome from 64.110.*.* > or from.. 64.110.*.* > > any ideas? I'm using > - PHP Version 4.0.4pl1 > - Apache/1.3.14 > - Smarty 1.4.5 > > -- > Pablo Veliz > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.smarty.general (#1535) next »