我试图将一些变量传递给 PHP 文件以运行 SQL 查询。然而,JavaScript 将这些变量作为对象传递。为什么会这样?我怎样才能改变它?
<?php include 'dbconfig.php';?>
<?php header('Content-Type: text/html; charset=utf-8');?>
<!DOCTYPE HTML PUCLIC "-//W3C//DTDHTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>LIBRARY DATABASE</TITLE>
<link rel="stylesheet" type="text/css" href="mytable.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" type="text/css" href="jquerycss.css">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-1.8.3.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var new_dialog = function (type, row) {
var dlg = $("#dialog-form").clone();
var memberID = dlg.find(("#memberID")),
MFirst = dlg.find(("#MFirst")),
MLast = dlg.find(("#Mlast")),
Street = dlg.find(("#Street")),
number = dlg.find(("#number")),
postalCode = dlg.find(("#postalCode")),
Mbirthdate = dlg.find(("#Mbirthdate"));
type = type || 'Create';
var config = {
autoOpen: true,
height: 500,
width: 600,
modal: true,
buttons: {
"Create an account": save_data,
"Cancel": function () {
dlg.dialog("close");
}
},
close: function () {
dlg.remove();
}
};
代码的目的是显示一个表格,并在旁边进行编辑和删除。删除按钮工作正常,但是为了编辑,我需要将上面提到的变量传递给一个 php 文件