【发布时间】:2013-09-25 21:21:58
【问题描述】:
我正在制作一个工具来提取 eve API 数据,并使用 GET 表单获取数据并访问 key ID 和 code 以访问数据。然后,这会提取键上的第一个字符 ID 并获取所有字符数据。
例如网址是:
whatever.com/APIChecker/?keyID=123456&code=ABCDEFGHIJKL
我通过它们创建的会话变量提取这些变量。
我现在正在尝试做的是现在有一个 for 循环,它为键上的每个字符放置按钮,以便您可以在字符之间轻弹,我正在尝试并尝试隐藏在按钮中的 get 和 post 方法,但是似乎无法得到我想要的结果。它似乎没有取出我试图传递的变量并将其添加到 $_SESSION 数组或 $_POST 或 $_GET - 我已经在所有这些变量上尝试了 print_r 但我无法得到任何输出.
这是我主页上的主要表单:
<form method="get" action="APIChecker/" >
<legend> Submit an API Key</legend>
<div class="control-group">
<label class="control-label">Key ID:</label>
<div class="controls">
<input type="text"
class="input-small"
name="keyID""/>
</div>
</div>
<div class="control-group">
<label class="control-label">Verification Code:</label>
<div class="controls">
<input type="text"
class="input-xxlarge"
name="vCode"
/>
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn">Submit API</button>
</div>
</div>
我现在要做的是从另一个页面获取另一个会话变量 - 它更新一个变量并刷新页面,keyID 和 code 不变。
如:
whatever.com/APIChecker/?keyID=123456&code=ABCDEFGHIJKL **&charID=654321**
所以$_SESSION['keyID'] = 123456
&$_SESSION['code'] = ABCDEFGHIJKL
&$_SESSION['charID'] = 654321
我试过的是:
<form method="get" action="" >
<div class="control-group">
<div class="controls">
<button type="submit" class="btn">
<input type="hidden"
name="charID"
value="$charID"
/>
</button>
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn">Submit API</button>
</div>
</div>
</form>
【问题讨论】: