0
我在html中使用php变量。 $userProfile['institute']
在$userProfile['institute']
非空时显示正确的值。当$userProfile['institute']
为空时,它显示'/'。这里可能是什么问题?在HTML中使用php变量
Institute: <input type="text" name="institute" value=<?php echo $userProfile['institute']?> /><br />
使用** htmlentities **来防止注入攻击是一种很好的做法。 <?= htmlentities($ userProfile ['institute'])?> – user2182349