[Twisted-Python] HTTP POST method in php on twisted server

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Apr 20 09:36:33 EDT 2010

On 19 Apr, 05:29 am, tuxattack14 at gmail.com wrote:
>On Sun, Apr 18, 2010 at 8:53 PM, <exarkun at twistedmatrix.com> wrote:
>>On 16 Apr, 04:24 am, tuxattack14 at gmail.com wrote:
>> >Hi,
>> >I am trying to use php script on twisted server using twcgi.I want to
>> >make
>> >use of http POST method in that.What I want to do is, suppose I am
>> >having
>> >one html page say index.html and from that page I want to redirect to
>> >other
>> >php page and pass data to that php page using POST method.But I am 
>> >able
>> >to access any POST data in php script.When I debugged through
>> >twcgi.CGIScript.render method, I didn't find any reference to POST
>> >data.So
>> >how can i make use of POST data in php ?
>>I don't really understand the question.  You have a lot of stuff going
>>on here:
>>  * HTTP POSTs
>>  * Redirects
>>  * CGIScript
>>  * PHP
>>Can you try to describe the scenario you're trying to get working step
>>by step, carefully separating each of these different pieces?
>>You may also want to post follow-ups to the twisted-web mailing list
>>Twisted-Python mailing list
>>Twisted-Python at twistedmatrix.com
>My aim is to build a server that will support file uploading on server 
>uploading is to be done using web browser.So i selected php script for 
>I made a simple html form.
>><div align="center">
>><br />
>><form enctype="multipart/form-data" action="upload_file.php" 
>>  Please choose a file: <input name="upload_file" type="file" /><br />
>>  <input type="submit" value="Upload" />
>>  </form> </body>
>Now this file is sent using POST method and then it will redirect to a 
>script named upload_file.php.
>So to make use of php i used twcgi.PHPScript. When i checked i am not
>getting POST data in php code.
>Execution calls twcgi.CGIScript.render method internally.When i checked 
>this render method, data sent using POST is available in request.args
>variable but not sent to php CLI.
>Whereas in case of GET method the url is parsed and data sent using GET
>method is put in qargs variable and then sent to php CLI.

Can you post a short example (<http://sscce.org/>) that demonstrates 


More information about the Twisted-Python mailing list