Takara
05-07-2002, 01:01 AM
I'm making a hack, and I'm wondering how to use iff as VB does. This is what is in newreply.php:
$ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
Now, if I wanted to convert this:
if (getenv("HTTP_X_FORWARDED_FOR")!="") {
$proxyip=getenv("HTTP_X_FORWARDED_FOR");
}
to use iff, would it look something like this:
$proxyip=iif(getenv("HTTP_X_FORWARDED_FOR")!="",getenv("HTTP_X_FORWARDED_FOR"));
I'm not quite sure, at the end of the one VB uses there is ,$HTTP_HOST. I'm not sure what to replace that with, or with anything at all.
Thanks :bunny: (I just love that bunny ^^)
$ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
Now, if I wanted to convert this:
if (getenv("HTTP_X_FORWARDED_FOR")!="") {
$proxyip=getenv("HTTP_X_FORWARDED_FOR");
}
to use iff, would it look something like this:
$proxyip=iif(getenv("HTTP_X_FORWARDED_FOR")!="",getenv("HTTP_X_FORWARDED_FOR"));
I'm not quite sure, at the end of the one VB uses there is ,$HTTP_HOST. I'm not sure what to replace that with, or with anything at all.
Thanks :bunny: (I just love that bunny ^^)