[Twisted-Python] HTTP POST method in php on twisted server
tuxattack14 at gmail.com
Mon Apr 19 01:29:11 EDT 2010
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:
> >I am trying to use php script on twisted server using twcgi.I want to
> >use of http POST method in that.What I want to do is, suppose I am
> >one html page say index.html and from that page I want to redirect to
> >php page and pass data to that php page using POST method.But I am not
> >to access any POST data in php script.When I debugged through
> >twcgi.CGIScript.render method, I didn't find any reference to POST
> >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 and
uploading is to be done using web browser.So i selected php script for file
I made a simple html form.
> <div align="center">
> <br />
> <form enctype="multipart/form-data" action="upload_file.php" method="POST">
> 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 php
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 in
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python