$_POST data不能用于./ 1 up文件夹操作


$_POST data does not work with ../ 1 up folder action

我的表单$_POST数据工作得很好当我把action.php文件直接放在我的主机上的index.php文件中,当我把php文件移动到包含文件夹,像这样:

<!-- This works perfectly fine -->
<form id="test" action="action.php"  method="POST" >
<!-- This does NOT pass the $_POST data but it goes to the php file and outputs the print test I put in the action.php file. so it is going where it needs to go but it is losing the POST data for some weird reason -->
<form id="test" action="../includes/action.php"  method="POST" >

有效的文件夹结构

(ROOT DIR)Test form
-js
-img
-index.php
-action.php

不能工作的文件夹结构

(ROOT DIR) includes
- action.php
(ROOT DIR) Test form
-js
-img
-index.php

甚至将包含文件夹权限设置为chmod 777,运气不好。直接把文件放回原来的位置,得到的数据打印结果就很好了。

为什么会发生这种情况?没有什么改变,但形式的行动。一旦我这样做了,当我试图测试它时,所有的数据都会丢失。

你做事的方式

<form id="test" action="../includes/action.php"  method="POST" >

表示"yoursite.com/../includes/action.php",它不会工作。

尝试:

<form id="test" action="/includes/action.php"  method="POST" >