php - Undefined Variable? Can't find the solution -
so have aquired php script checks , grabs server information servers of popular game 'minecraft'. in script seems work perfect 1 error,
notice: undefined variable: users in c:\xampp\htdocs\web-root\unnamed\share\site\fol\avatarquery.php on line 74
i have no idea why happening (i relatively new php), here's php code;
<?php //take username values array & grab avatars minotar. foreach($array_list $key => $value){$users .= "<a data-placement=\"top\" rel=\"tooltip\" style=\"display: inline-block;\" title=\"".$value."\"> <img src=\"https://minotar.net/avatar/".$value."/50\" size=\"40\" width=\"40\" height=\"40\" style=\"width: 40px; height: 40px; margin-bottom: 5px; margin-right: 5px; border-radius: 3px;\"/></a>";} //display avatars when there players online. if($data_general['players']['online'] > 0) { print_r($users); } //if no avatars can shown, display error. else { echo "<div class=\"alert\"> there no players online @ moment!</div>"; } ?>
any , appreciated! thank you!
oh , code <img src="
line 74.
thats notice error thats warning concatenating variable doesn't yet exist.
add line above foreach remove it:
$users = ""; foreach($array_list $key => $value.....
Comments
Post a Comment