$_POST 数据不适用于 ../ 1 up 文件夹操作
$_POST data does not work with ../ 1 up folder action
当我将 action.php 文件直接放在我主机上的 index.php 中时,当我向上移动 php 文件时,我的表单 $_POST 数据工作得很好1 个文件夹并进入 includes 文件夹,如下所示:
<!-- 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" >
当我将 action.php 文件直接放在我主机上的 index.php 中时,当我向上移动 php 文件时,我的表单 $_POST 数据工作得很好1 个文件夹并进入 includes 文件夹,如下所示:
<!-- 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" >