我正在寻找一种方法来做那样的事情
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if (isset($_POST["array"])) //Reset Button
{
print_r($_POST["array"]); //Able to print all the "whatever"Value below
}
}
来自像这样的HTML代码
<form name="array" method="post" action="W3schoolTest.php">
<?php
foreach ($columnsList as $column) {
echo $column.' : ';
echo '<input type="text" name="'.$whateverItShouldBeFind.'"><br />';
}
echo '<br /><input type="submit"/>';
?>
</form>
我知道我可以在$_SESSION
注册我的whateverValue名称,但我正在寻找合适的方法。
谢谢!
答案 0 :(得分:1)
是的,应该可以使用以下符号:
对于POST:
$directory = get_bloginfo('template_directory')."/images/myImages/";
$images = glob($directory . "*.svg");
echo '<pre>';
print_r($images);
echo '</pre>';
echo $directory.'abnamro.svg">';
foreach($images as $image)
{
echo $image;
}
在服务器上:
<input type="text" name="array[]" value="1" />
<input type="text" name="array[]" value="2" />
<input type="text" name="array[]" value="some-text" />
应该产生如下内容:
var_dump($_POST);
对于GET: 该URL应如下所示: