PDA

View Full Version : Basic php conditional code


Greg
05-17-2003, 09:32 PM
This code checks to see if a user arrived at IRC via a link that included a NICK and a Room/channel name...


if ( !empty($_POST['Nick']) ) { // if nick POST var is not empty
$nickname=$_POST['Nick']; // set nick
$autoconnect=1; // set autoconnect ON
}
else { // else
if ( $Nick == "" ) { // if nick in URL is not there
$autoconnect=0; // set autoconnect OFF
$nickname="Guest????"; // fill in nick with random guest nick
}
else { // else if nick in URL
$nickname=$Nick; // set nick
$autoconnect=1; // set autoconnect ON
}
}
if( $room=="" ) { // if room name not set
$room="codeblu"; // set to default codeblu
}

Zero Tolerance
05-18-2003, 07:30 AM
man that orange against grey KILLS my eyes....lol

looks like a pretty basic "if/else" statement

Greg
05-18-2003, 08:31 AM
Yeah, I was just filling some space.
The orange is pretty ugly though.