Project

General

Profile

Actions

Bug #2612

closed

Strange behaviour with form

Added by Wintermute over 9 years ago. Updated about 9 years ago.

Status:
Invalid
Priority:
Normal
Category:
-
Target version:
-
ASK QUESTIONS IN Forums:

Description

When sending a form with POST method Lighthttpd returns GET method and $_POST and $_FILES are empty if the action tag does not contain the script name.

<form method="post" action="localhost/test/" enctype="multipart/form-data">

<form method="post" action="localhost/test/index.php" enctype="multipart/form-data">
<label for="user">User</label><input name="user" />
<label for="pass">Pass</label><input name="pass" />
<input type="submit" name="submit" value="Submit" />
</form>

index.php :
print_r( $_POST );
echo $_SERVER['REQUEST_METHOD'];
?>

The result is

Array ( )
GET

I have the following configuration :
  • Debian Jessie
  • Lighttpd 1.4.35-4
  • PHP 5.6.5-1

Files

15-fastcgi-php.conf.txt (351 Bytes) 15-fastcgi-php.conf.txt Wintermute, 2015-02-08 22:08
lighttpd.conf.txt (1.02 KB) lighttpd.conf.txt Wintermute, 2015-02-08 22:09
log.txt (4.38 KB) log.txt Wintermute, 2015-02-09 10:59
Actions #2

Updated by stbuehler over 9 years ago

  • Status changed from New to Invalid
  • Priority changed from High to Normal
  • the name is still "lighttpd"
  • stay away from the priority setting
  • your action urls look broken - if "localhost" is supposed to be the hostname (and not a subfolder) you probably should use //localhost/test/index.php
  • I guess you have a redirect to index.php which breaks the POST. check the network log in your browser. the full config is missing (lighttpd -p).
  • test with curl and show the complete headers
Actions #3

Updated by Wintermute over 9 years ago

stay away from the priority setting

I don't understand ?

your action urls look broken - if "localhost" is supposed to be the hostname (and not a subfolder) you probably should use //localhost/test/index.php

The actual URL is :
<form method="post" action="http://localhost/test/&quot; enctype="multipart/form-data">

I guess you have a redirect to index.php which breaks the POST. check the network log in your browser. the full config is missing (lighttpd -p).

jerome@debian:~$ sudo lighttpd -p
2015-02-09 10:58:25: (server.c.617) No configuration available. Try using -f option.

Actions #4

Updated by Wintermute over 9 years ago

  • Status changed from Invalid to Reopened

Is there a solution ?

Actions #5

Updated by stbuehler about 9 years ago

  • Status changed from Reopened to Invalid

There is nothing wrong with lighttpd - your browser log shows a GET.

Actions

Also available in: Atom