Home Backend Development PHP Tutorial 未知缘故PHP突然无法获取POST url encoded数据

未知缘故PHP突然无法获取POST url encoded数据

Jun 13, 2016 pm 01:09 PM
apache form php post quot

未知原因PHP突然无法获取POST url encoded数据
碰到一个非常诡异的问题:
XP Pro+SP3系统。
昨天程序原本都没问题,重启过一次apache之后,发现PHP无法取得POST url encoded 数据了,但是GET和POST multipart/form-data都可以正常获取。
也就是说当

的时候,var_dump($_POST)为 array(0){};
的时候,$_POST里面才会有值。
确定浏览器发送了POST数据了,无论是谷歌火狐IE6,传统表单提交还是ajax。
也不是只部分页面出现这个问题,所有的php都不行,甚至连phpMyAdmin都无法登录了。

今天尝试了重新安装php5.2.17,重新安装apache2.2.22.0,都无法解决。
没办法,只好使用 IIS5.1 + PHP5.2.17 isapi再测试,结果这回倒可以了,但我总不好改用IIS吧……

回忆昨天重启apache后出现问题之前,好像是运行过一次php下的go-pear.bat,然后在第一个界面就直接点叉关闭了;也有可能修改了一些其他的php.ini配置;
但最后我都重新解压了原版的php,重装了apache,按说应该不太可能是他们的原因?还是操作系统出什么诡异的状况了?

哪位大侠碰到过这种问题么?我真不想重装系统……

------解决方案--------------------
先看看 enctype='application/x-www-form-urlencoded' 结果如何?


------解决方案--------------------
你可以用$_QUERST接收一下值,看是否能接收到post过来的值,至于$_POST不能接受值,应该是配置问题,可能是你php.ini中的某个参数改变导致的!试着修改一下这个参数register_global
------解决方案--------------------
探讨
不指定enctype时,默认就是"Content-Type:application/x-www-form-urlencoded"。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles