所以我正在使用grapesjs网站构建器,我想将数据存储到数据库中
这是index.php
中的代码var editor = grapesjs.init({
storageManager:{
type: 'remote',
//end point where to save data
urlStore: 'save.php',
params: {},
autosave: false,
},
cmdm.add('save-db', {
run: function(editor, sender){
sender && sender.set('active', 0);
//turn off the button
editor.store();
}
});
和这里的save.php
<?php
session_start();
include_once "../login/dbconf.php";
$dbconn = mysqli_connect($host, $username, $password, $db_name);
if(isset($_POST['html'])){
$created = time();
$sql = "INSERT INTO templates (html, created) VALUES ('$_POST['html']',
$created)";
if(mysqli_query($dbconn, $sql)){
echo 'done';
}else{
die("Error:". mysqli_error($dconn));
}
}
但我不会向我的表中插入任何数据,这是模板,但在开发人员工具中它表示存储&gt;对象,这是什么意思?