I have this code and when applied to my page it makes that page go blank. when i remove this code from the page the page goes back to normal. I cant figure out whats wrong with it.
[php]<?php
$thisPage = basename($_SERVER[‘PHP_SELF’]);
$thisGroup = “”;
$agList = “”;
$mgList = “”;
$_SESSION[‘group’] = “notSet”;
if ($thisPage == “group.php”){
if(isset($GET[“g”])){
$thisGroup = preg_replace(’#[^a-z0-9]#i’, ‘’, $_GET[‘g’]);
$_SESSION[‘group’] = $thisGroup;
}
}
if (isset($_SESSION[‘username’])) {
// All groups list
$query = mysqli_query($db_connect, “SELECT name,logo FROM groups”);
$g_check = mysqli_num_rows($query) or die (mysqli_error($db_connect));
if ($g_check > 0){
while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$agList .= ‘<a href="group.php?g=’.$row[“name”].’"><img src=“groups/’.$row[“name”].’/’.$row[“logo”].’” alt="’.$row[“name”].’" title="’.$row[“name”].’" width=“50” height=“50” border=“0” />’;
}
}
// My groups list
$sql = “SELECT gm.gname, gp.logo
FROM gmembers AS gm
LEFT JOIN groups AS gp ON gp.name = gm.gname
WHERE gm.mname = ‘$log_username’”;
$query = mysqli_query($db_connect, $sql);
$g_check = mysqli_num_rows($query);
if ($g_check > 0){
while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$mgList .= ‘’;
}
}
}
?>[/php]