webguync Posted April 28, 2009 Share Posted April 28, 2009 just curious as to the function of the colon is in this piece of PHP code. echo ('access=accept&uid='.$userID): .'&username='.urlencode($username); Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 28, 2009 Share Posted April 28, 2009 It makes this piece of code invalid. Quote Link to comment Share on other sites More sharing options...
Cosizzle Posted April 28, 2009 Share Posted April 28, 2009 is it within an if statement? ie <?php $a = (!empty($a)) ? TRUE : FALSE; ?> Quote Link to comment Share on other sites More sharing options...
webguync Posted April 28, 2009 Author Share Posted April 28, 2009 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); } Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 28, 2009 Share Posted April 28, 2009 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. Quote Link to comment Share on other sites More sharing options...
nankoweap Posted April 28, 2009 Share Posted April 28, 2009 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 Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 28, 2009 Share Posted April 28, 2009 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. Quote Link to comment Share on other sites More sharing options...
nankoweap Posted April 28, 2009 Share Posted April 28, 2009 hmmm... i reckon that's possible. uuuuhhhhggg! Quote Link to comment Share on other sites More sharing options...
webguync Posted April 28, 2009 Author Share Posted April 28, 2009 your right another if statement that I didn't include in the code post. I will take out the colon since it seems to be an error. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.