使用jquery mobile时未在PHP中设置URL变量
我有几个页面,当输入被提交时,它将进入一个php文件,该文件将检查url变量这可能是executeeffects.php?option=blockuser 但是当我转到页面时,页面在executeeffects php文件中只显示“undefined”,它有一个检查功能来检查是否设置了变量,如果设置了变量,它会回显一件事,如果没有设置,则会回显另一件事,但是我没有让它回显undefined,所以我不知道这是从哪里来的,代码如下 有人能告诉我这是jquery mobile的问题还是我遗漏了什么吗 block.php使用jquery mobile时未在PHP中设置URL变量,php,jquery,html,jquery-mobile,Php,Jquery,Html,Jquery Mobile,我有几个页面,当输入被提交时,它将进入一个php文件,该文件将检查url变量这可能是executeeffects.php?option=blockuser 但是当我转到页面时,页面在executeeffects php文件中只显示“undefined”,它有一个检查功能来检查是否设置了变量,如果设置了变量,它会回显一件事,如果没有设置,则会回显另一件事,但是我没有让它回显undefined,所以我不知道这是从哪里来的,代码如下 有人能告诉我这是jquery mobile的问题还是我遗漏了什么吗
<!DOCTYPE html>
<html>
<head>
<title>Ryan Kelly</title>
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script src="effects.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Ryan Kelly</h1>
</div><!-- /header -->
<div data-role="content">
<label for="basic">Username:</label>
<input type="text" name="name" id="basic" value="" />
<input type="text" name="name" id="blocked" value="" />
<a href="executeeffects.php?option=block" data-role="button" class="button">Submit</a>
<?php include('listusers.php'); ?>
</div><!-- /content -->
</div><!-- /page -->
</body>
</html>
瑞安·凯利
莱恩-凯利
用户名:
executeeffects.php
<?php
if(isset($_GET['option'])){
echo 'something is set!';
} else {
echo 'nothing is set!';
}
?>
您说“我有几页,当提交输入时,它将进入一个php文件,该文件将检查url变量这可能是executeeffects.php?option=blockuser”
这:
将不会提交输入值,除非您使用的是未发布的某种类型的jQuery,在这种情况下,需要以不同的方式执行
要提交输入值,您需要使用
var\u dump($\u GET)是什么;假设executeeffects.phpits上的输出检查是否设置了某些内容,但它不会回显一条语句或另一条语句,而是转到executeeffects页面,并说UnfinedRemove executeeffects.php内的代码,并将其替换为var_dump($\u GET);它输出了什么吗?它说未定义,但当我刷新页面时,它说array(1){[“option”]=>string(5)“block”}您问题中提供的代码是executeeffects.php中唯一的代码吗?
<input type="text" name="name" id="basic" value="" />
<input type="text" name="name" id="blocked" value="" />
<a href="executeeffects.php?option=block" data-role="button" class="button">Submit</a>