当使用jquery移动时,URL变量没有在PHP中设置


URL variable not being set in PHP when using jquery mobile

我有几个页面,当输入提交时,它会去一个PHP文件检查url变量这可能是executeeffects.php?选择= blockuser

但是当我进入页面页面只是说"undefined"在executeeffects PHP文件中它有一个检查功能来检查一个变量是否被设置,如果是,它会返回一件事如果不是,但是我没有让它返回undefined所以我不知道这是从哪里来的,代码在

下面

有人能告诉我,如果这是一个问题与jquery移动或如果我错过了什么请?

block.php

<!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?选择= blockuser "

:

<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>

不会提交输入的值,除非您正在使用某种类型的jQuery,您没有发布在这种情况下,这将需要做不同的。

提交输入的值需要使用<form>