Ben bir PHP acemi ve ben onları gönderirseniz ben POST değişkeni bazen boş olması ile ilgili bir sorun yaşıyorum. Bu zor beni anlamaya için yapıyor kısmı bu her zaman olmaz, ve ben genellikle sadece sayfayı yenileyerek benim PHP programda sonrası verileri alabiliriz. Bazen birkaç kez alacak, ama bir kez veri yoluyla gelmek bir kez, o para üzerinden gelmeye devam edecek.
Diğer PHP uygulamaları (Wordpress ve diğerleri) ince iş ve hataları asla pes, bu yüzden benim php uygulaması ile ilgili bir sorun var eminim.
PHP 4.2.9 bir CentOS 5.2 sunucu üzerinde yüklü ve KeepAliveTimeout 1'e ayarlanmış.
I gönderilen verileri işleme hangi uygulama için kodu:
<?php
session_start();
if (isset($_SESSION['username'])) {
$expire = time() + (60*60*24*30);
setcookie("username", $_SESSION['username'], $expire);
}
header("Cache-control: no-cache");
if (!isset($_SESSION['username'])) {
header('Location: ./login.php');
die();
}
if(empty($_SERVER['CONTENT_TYPE'])){
$type = "application/x-www-form-urlencoded";
$_SERVER['CONTENT_TYPE'] = $type;
}
var_dump($_POST);
echo "\n";
var_dump($_SERVER);
?>
Hiç bir yardım mutluluk duyacağız
Edit: I have found one difference between working post requests and the ones that fail. Firebug tells me that when the post fails, the status is a 302 redirect instead of 200 ok. Im not really sure what can cause that, but I have the header cache control in sending form just as it appears in the above code snippet.
Herhangi bir fikir?