我无法逃避getItems函数内部的PHP变量:问题逃逸PHP变量
while($row = mysql_fetch_array($data))
{
echo "<div class='favorite'>";
echo "<div style='display: inline;'>".$row['Item']."</div>";
if ($row['UID'] = $uid) {
echo "<div id='unlock'>Info</div>";
} else {
echo "<div id='unlock' onclick='getItems('".$row['Item']."')'>Unlock</div>";
}
echo "</div>";
}
呈现时(?为使字)反正,当我看到它在我的网站,它说:
onclick="getItems(" whatever')'
我在做什么错?
你可以看到这里的代码: http://www.chusmix.com/game/insert/get-items.php?user=19
你能否周围的代码添加到发帖?看起来这可能是一个从前一行开始的语法问题。 – Zoey
你想回应什么? –
尝试:echo“