好吧,我想将3个文本框值存储到我的mysqli数据库中,运行这些代码后什么都没有发生!如果发生任何情况,则将数字“ 1”存储到数据库中,而不是“文本框值”
PHP代码:
<?php
include 'displaycustomersdb.php'; //this file give $Ccode from user sessions and config.php is in it.
global $textareamsg;
global $title;
global $reciver;
global $sender;
$textareamsg = (isset($_GET['textarea']));
$title = (isset($_GET['title']));
$reciver = (isset($_GET['reciver']));
if (isset($_GET['sendmsg'])) {
$sql_msg = mysqli_query($link, 'INSERT INTO messaging (title, message, sender, reciver) VALUES (' . $title . ',' . $textareamsg . ',' . $Ccode . ',' . $reciver . '');
}
?>
HTML代码:
<?php include 'sendmsg.php'; ?>
<form method="get">
<i class="fas fa-envelope-open-text"></i><input type="text" placeholder="Ttitle here ..." name="title">
<br>
<br>
<i class="fas fa-user-plus"></i><input type="text" placeholder="TO" name="reciver">
<br>
<br>
<textarea rows="10" cols="100" placeholder="textarea" name="textarea" style="padding:10px;"></textarea>
<br>
<br>
<button type="submit" name="sendmsg"><i class="far fa-share-square"></i>Insert</button>
</form>
慕盖茨4494581
梦里花落0921
侃侃无极