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);
	}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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.

 

It seems that second else is for yet another if above the one that was posted.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.