我正在嘗試更新使用php和數據庫的查詢,並在頁面中顯示textarea。這是我的代碼,問題是我用一些空格來獲取文本區域。請幫忙。在textarea發生空白
if (isset($_POST["events"])&&isset($_POST["description"]))
{
$id=$_POST["id"];
$title=$_POST["events"];
$description=$_POST["description"];
}
HTML
<form action="hotel1_galery_eventedit.php" method="post" class="col-sm-4" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $val->event_id;?>">
<div class="form-group has-info">
<label class="control-label" for="inputSuccess">Event title</label>
<input type="text" class="form-control" name="events" value="<?php echo $val->event_title;?>">
</div>
<div class="form-group has-info">
<label class="control-label" >Event Description</label>
<textarea name="description" class="form-control text-left" rows="3">
<?php echo $val->event_description;?>
</textarea>
</div>
</form>
空白可能換行符增加空間.. – Rayon
''如果它仍然會產生空間,在'$ val-> event_description'中加入'&nbsp'或'
' –