问题描述
所以我正在将此链接提交到我的php代码中:
So I am submitting this link into my php code:
由于某种原因,我什至不能在下面的网址中使用example.com,而只需将目录添加到脚本中即可.
For some reason I cannot even use example.com in the url below, but just add the directory to the script before.
https://www.example.com/test.php?info1234=3177%3B315961%3B317451%3B315511&info3598=121618%3B136803%3B13830%3B20532
上面的example.com网址是1个单数字符串.用户仅提交一件东西.那件事恰好是一个包含自己参数的php网址.
但是,当我使用表单提交它时,我得到了这个$_GET
数组(这是我想要的结果,但是另一种方式也很好):
However, when I submit it using the the form, I get this $_GET
array (This is my desired outcome but the other way is fine too):
Array
(
[myurl] => https://www.example.com/test.php?info1234=3177;315961;317451;315511
[info3598] => 121618;136803;13830;20532
)
然后,如果我通过将myurl自己放入实际url中来自己提交到程序的url中来提交它.如果我键入此URL并提交localhost/test.php?myurl=https://www.example.com/test.php?info1234=3177%3B315961%3B317451%3B315511&info3598=121618%3B136803%3B13830%3B20532
,则会得到以下$_GET
数组:
And then if I submit it by putting the myurl into the actual url myself into my program's url myself. If I typed this url, and submitted it localhost/test.php?myurl=https://www.example.com/test.php?info1234=3177%3B315961%3B317451%3B315511&info3598=121618%3B136803%3B13830%3B20532
, I get this $_GET
array:
Array
(
[myurl] => https://www.example.com/test.php?info1234=3177%3B315961%3B317451%3B315511&info3598=121618%3B136803%3B13830%3B20532
)
test.php
test.php
<?php
print_r($_GET);
?>
<form action="test.php" method="get">
myurl: <input type="text" name="myurl"><br>
<input type="submit" value="Submit">
</form>
推荐答案
表单提交-提交表单数据.您必须将额外的参数添加为隐藏的输入.即:
Form submission - submits form data. You'll have to Add the extra parameter as a hidden input. ie:
<input type="hidden" id="info" name="info3595" value="entervaluehereinsuitalbleformat">
这篇关于无论您如何提交信息,都获得统一的$ _GET数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!