如何解决FORM method =" post"改变“。”到“_”请? [英] How to work around FORM method="post" changing "." to "_" please?
问题描述
这是我的表格:
< html>
< head>< / head>
< ; body>
< FORM ACTION =" code.php" method =" post">
< INPUT TYPE = SUBMIT NAME =" arty.jpg" VALUE =" Action">
< / FORM>
< / body>
< / html> ;
这里是code.php:
<?php
if(!empty($ _ POST) )){
foreach($ _ POST作为$ myFile = $ value){
echo" $ myFile";
}
}
?>
我所期待的是代码将打印出来arty.jpg当你点击按钮
时。
而是打印出arty_jpg
所以Post方法正在改变。到_
但是我需要传递可能包含_的文件名。和。
字符。
我想我需要某种逃避和无视功能。
请有人推荐一个。
PS我正在处理文件上传/下载/删除表格这个
链接:
http://willyhoops.com/upload/
非常感谢...
here is my form:
<html>
<head></head>
<body>
<FORM ACTION="code.php" method="post">
<INPUT TYPE=SUBMIT NAME="arty.jpg" VALUE="Action">
</FORM>
</body>
</html>
here is code.php:
<?php
if(!empty($_POST)){
foreach($_POST as $myFile =$value){
echo "$myFile";
}
}
?>
What I was expecting is that the code would print out "arty.jpg" when
you click the button.
Instead it prints out "arty_jpg"
So the Post method is changing "." to "_"
But I need to pass the filename which may include both "_" and "."
character.
I guess I need some kind of escape and unescape funtion.
Please can someone reccomend one.
PS I am working on a file upload / downalod / delete form at this
link:
http://willyhoops.com/upload/
Many Thanks...
推荐答案
_POST)){
foreach(
_POST)){
foreach(
_POST as
myFile =
这篇关于如何解决FORM method =" post"改变“。”到“_”请?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!