Jump to content

explain the colon in this piece of code


webguync

Recommended Posts

it is actually, it may be invalid the way it is now.

 


if($scores->num_rows) {
		echo ('access=deny&record=true&uid='.$userID);
		}else {
		echo ('access=deny&record=none&uid='.$userID.'&lid='.$logID);
		}
	}else {
	echo ('access=accept&uid='.$userID): .'&username='.urlencode($username);
	}

is it within an if statement?

ie

<?php
$a = (!empty($a)) ? TRUE : FALSE;
?>

 

It's not an if statement. It's a ternary operator. You can't have language constructs as its parameters.

 

webguync : My guess is that someone just left it here, while it should be part of a string to echo.

it is actually, it may be invalid the way it is now.

 

if($scores->num_rows) {
  echo ('access=deny&record=true&uid='.$userID);
} else {
  echo ('access=deny&record=none&uid='.$userID.'&lid='.$logID);
} else {
  echo ('access=accept&uid='.$userID): .'&username='.urlencode($username);
}

 

given the code you posted, that colon doesn't matter cuz it's failing before that bit of code is parsed. can't have two else's. and something has to be done with that colon too unless that's some php code i'm not familiar with.

 

jason

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.