I checked out this post but no luck : PHP - concatenate or directly insert variables in string
The suspect in question: showUser(3, change, " . $name . ");'>
$name breaks the code; the second $name does work. The variable does not get passed to the function.
I have been testing for hours to get this to work! It seems like it should work.
I tried checking other places in the application to see what the problem could be and this seems to be the culprit.
<?php
if ($q !== "") {
$q = strtolower($q);
$len=strlen($q);
foreach($a as $name) {
if (stristr($q, substr($name, 0, $len))) {
if ($hint === "") {
$hint = "<p onClick='DoIt(); showUser(3, change, " . $name . ");'>" . $name . "</p>";
} else {
$hint .= "\n" . "$name";
}
}
}
?>