HallMarc Websites wrote:
>> I'm trying to debug an issue which I think is more to do with Apache
>> PHP, but perhaps someone else has experience with this. Using
>> 11.4, custom compile of kernel 2.6.38, custom compile of Apache
>> 2.2.17, and PHP 3.3.6. phpinfo() page works correctly so my
>> configured to deal with PHP.
>> Using a plain .php file which contains a form with only a submit
> at first
>> the browser loads the .php correctly. Then click submit in the form,
>> browser asks me if I want to open or download and save locally the
> file I
>> have requested. This is disturbing since it is potentially a
>> 1. This only happens with method=POST. method=GET works correctly.
>> 2. Using the same form as an .html file, same failure, so it is not
>> connected to PHP. I have posted an issue with Apache (50978) but no
>> response yet.
> Can you post a link; if not:
> Can you show the contents of the php file being downloaded or at
> first and last 15 lines?
> Not sure why the method would make the diff yet here we are. You
> check the variables_order string in your php.ini file.
> And have you tried adding
> enctype="multipart/form-data" or
> enctype="application/x-www-form-urlencoded" (more suited for GET)
> to the FORM tag ie <FORM id="formID" action="some_action.php"
> method="POST" enctype="multipart/form-data">
> The reason I asked the last part is because you stated that it works
> if you pass via GET and not when you use POST and because they are
> encoded differently and it could be that the server isn't set
> decode $_POST data and so does the download instead.
> More details about how you are collecting the form data and how the
> is then processed would be helpful.
Thanks for your interest.
Here is my complete test php file:
echo "crash test<br />";
$cont = "<form action='".$_SERVER['PHP_SELF']."' method='POST'>
<input type='submit' name='button' value='submit' />
echo "ended<br />";
Running this file produces the form correctly at first. Then click
submit and the response of the server is to send the next page as text.
In the background a child process dies. I guess this severs the link to
the php handler. If httpd is run with -X to generate a single process,
this process dies and the server stops, with no effort to serve up a
file of any kind.
If I take the above file and convert to regular html, same behaviour.
This is why I say it has little to do with PHP. However if used in
connection with php it can result in some nasty security implications.
I did try adding enctype, but this did not help. I think this is
because the process is killed very early in dealing with the post
method and never gets to formulating something to send back.
I did get a backtrace from gdb, and this is posted on the
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php