PHP:可能自动获取所有发布的数据? [英] PHP: Possible to automatically get all POSTed data?
本文介绍了PHP:可能自动获取所有发布的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能?
解决方案
当然。 $ _ $ POST 数组: $ key => $ value)
echoField.htmlspecialchars($ key)。is.htmlspecialchars($ value)。< br>;
Simple question: Is it possible to get all the data POSTed to a page, even if you don't know all the fields?
For example, I want to write a simple script that collects any POSTed data and emails it. I can foresee that the fields in the form are likely to change a lot over time, and so to save myself some time in the long run, I was wondering if I could write something that automatically gathered everything?
Is it possible?
解决方案
Sure. Just walk through the $_POST
array:
foreach ($_POST as $key => $value)
echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
这篇关于PHP:可能自动获取所有发布的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文