請幫助,我試圖讓用戶或訪客訪問我的網頁時,他們會看到一個禁用的文本區域,一旦他們登錄,他們就可以點擊編輯該文本區域。如果登錄/退出,顯示/隱藏textarea?
我已經非常設置了我想要它,但此刻如果用戶登錄文本區域從禁用的切換到可編輯的。但其他配置文件的所有其他文本區域消失,我希望這些留下來,登錄的用戶可以看到其他用戶,但不編輯它們?
希望我已經解釋清楚了。希望這可能嗎?
<?php if (isset($_SESSION['user_id'])) {
if ($user['id'] == $_SESSION['user_id']){
?>
<textarea id="area" rows="10" style="
width: 456px;
margin-top:3px;
text-align:left;
margin-left:-2px;
height: 122px;
resize: none;
border: hidden;"><?php echo $profile['bio'] ?> </textarea>
<?
}
}
?>
<?php
if (!logged_in()) {
?>
<textarea id="area-read" disabled="yes" style="
width: 456px;
margin-top:3px;
text-align:left;
margin-left:-2px;
height: 122px;
resize: none;
border: hidden;"><?php echo $profile['bio'] ?> </textarea>
<?
}
?>
謝謝:)這解決了它。 –