php代码中的两个php变量..
$areaid = filter_var($_GET["aid"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH);
$areaname = filter_var($_GET["aname"], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
$(document).ready(function() {
$("#submit_btn").click(function() {
var uareaname = <?php echo ($areaname) ?>;
var uareaid = <?php echo ($areaid) ?>;
post_data = {'userArea':userareaname,'userAreaid':uareaid}; Not able to post this data
$.post('review_me.php', post_data, function(response){
答案 0 :(得分:0)
好的替换这些行:
var uareaname = <?php echo ($areaname) ?>;
var uareaid = <?php echo ($areaid) ?>;
这些行:
var uareaname = '<?php echo ($areaname) ?>';
var uareaid = '<?php echo ($areaid) ?>';
字符串值必须位于quotes
。否则,它被视为变量。