PDA

View Full Version : iif


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 ^^)

Mark Hensler
05-07-2002, 05:48 AM
If you've just got to use it, try just NULL.

Takara
05-07-2002, 06:40 AM
Oh, thanks. Whats it for anyway?

Admin
05-07-2002, 12:09 PM
iif() is used to shorten simple:
if (whatever) {
// whatever
} else {
// whatever
}
blocks.

Takara
05-07-2002, 06:38 PM
hehe, simmilar to the mirc iif then. Thankies you two!

Scott MacVicar
05-07-2002, 06:50 PM
ooh another irc person what servers do you go on Takara?

Mark Hensler
05-07-2002, 06:53 PM
it's also like the SQL version

Admin
05-07-2002, 06:57 PM
Only on SQL it's just IF. :)

Takara
05-07-2002, 09:50 PM
Originally posted by PPN
ooh another irc person what servers do you go on Takara?

irc.enterthegame.com

I hang out in the Ragnarok Online chans, though Im just currently creating a new site/chan with a group of friends.