First, of all, you're calling your array element wrong. When specifying an associative index, the index must be specified as a string, e.g. between quotation marks:
- Code: Select all
<?
$arr = array('a' => 1, 'b' => 2);
// this is very wrong:
echo $arr[a];
// this is correct:
echo $arr['a'];
?>
Doing it without the quotes still works, but it's deprecated functionality and should never be done. You can read about it in the "Array do's and don'ts" section on
this page.
Secondly, I think your problem is that you're trying to access a variable from outside PHP. PHP ignores everything that isn't between <? and ?> tags. So, instead of this:
- Code: Select all
<a href="take_off_suspension.php?username=$usr[username]">Take off</a>
You want this:
- Code: Select all
<a href="take_off_suspension.php?username=<? echo $usr['username']; ?>">Take off</a>
Or you can use the short syntax:
- Code: Select all
<a href="take_off_suspension.php?username=<?= $usr['username'] ?>">Take off</a>