【发布时间】:2018-05-15 11:45:24
【问题描述】:
我无法使用函数urlencode 制作基于“topicnaam”的“url”列
我想要什么:我想要我的 url 由 topicnaam 制作。但是 topicnaam 需要一个 urlencode,所以它们在 'url' 中没有空格和其他符号
I tried to use the urlencode() function.
我的<form> 代码和更新函数
<?php
if(isset($_POST['react_btn'])){
unset($q1);
$q1['topicnaam'] = $app->check_string($_POST['topicnaam']);
$q1['board_id'] = $app->check_string($_POST['boardid']);
$q1['klant_id'] = $app->check_string($_POST['klantid']);
$q1['ledenpagina_id'] = $app->check_string($_POST['ledenpaginaid']);
$q1['omschrijving'] = $app->check_string($_POST['topicomschrijving']);
$app->insert_query('topics', $q1, 'id');
}
?>
<form action="" method="post">
<div class="form-group">
<label for="comment">Topicnaam:</label>
<textarea class="form-control resizenone" name="topicnaam" rows="1" id="comment" required></textarea>
<input type="hidden" name="klantid" value="<?php echo $_SESSION["klant_id"] ?>">
<input type="hidden" name="boardid" value="<?php echo $actiefboardid ?>">
<input type="hidden" name="ledenpaginaid" value="<?php echo $_SESSION["ledenpagina_id"]; ?>">
<label for="comment">Topic omschrijving:</label>
<textarea class="form-control resizenone" name="topicomschrijving" rows="3" id="comment required"></textarea>
<button type="submit" name="react_btn" class="btn btn-primary">Voeg topic toe</button>
</div>
</form>
【问题讨论】: