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