Languages :: PHP :: Recreate raw POST data.? |
|||
| By: norbs101 |
Date: 12/06/2003 00:00:00 |
Points: 405 | Status: Answered Quality : Excellent |
|
I have a php script that runs another scirpt written in K. The k scirpt needs to get the raw_post_data that php gets. But php always parses the raw post data when the content type is multipart/...., I need a function that can recreate the original data into say a variable using the $_POST. Also the php script must be dynamic enough to obtain the variable names inside the $_POST iteself. Since they will change and the amount of them changes. Any help is greatly appreciated. Norbert Jurkiewicz The Carlisle Group |
|||
| By: VGR | Date: 12/06/2003 04:47:00 | Type : Comment |
|
| K? It's new to me ! What is K ? Anywa, I think I understood your probem but don't have a slution. My workaround solution will be to make the PHP script build an auto-submitted POST FORM with the data from $_POST[] put into type=hidden fields that's easy. |
|||
| By: VGR | Date: 12/06/2003 04:52:00 | Type : Answer |
|
| something like : <?php echo "<form name=myform action=\"your_k_script_URI\" method=POST>"; foreach ($_POST as $var=>$value) echo "<input type=hidden name=$var value=\"$value\">"; echo "</form>"; echo "<script>document.myform.submit();</script>"; ?> |
|||
| By: norbs101 | Date: 12/06/2003 04:53:00 | Type : Comment |
|
| This is someone's quick descirption and critique of K. Just to give an insight. <A HREF="http://www.kuro5hin.org/story/2002/11/14/22741/791">http://www.kuro5hin.org/story/2002/11/14/22741/791</a> |
|||
| By: norbs101 | Date: 12/06/2003 04:55:00 | Type : Comment |
|
| The problem with that solution is that php does the processing of the form. All I need is the Original POST data submitted by the browser before it was parsed to pass into the stdin of the K program. The K program does all the form processing afterwards. N. |
|||
| By: VGR | Date: 12/06/2003 04:58:00 | Type : Comment |
|
| APL... souvenirs, souvenirs... |
|||
| By: VGR | Date: 12/06/2003 04:59:00 | Type : Comment |
|
| well, then don't pass anything to PHP but pass it to K ;-) |
|||
| By: norbs101 | Date: 12/06/2003 17:02:00 | Type : Comment |
|
| I wish it was that simple... K when compiled and run as a scirpt doesn't like environment variables from the server. Which is a big isssue. And a code redesign is not in my hands. |
|||
| By: bljak | Date: 12/06/2003 17:22:00 | Type : Comment |
|
| and why do you use K then? //bljak da unKnown |
|||
| By: VGR | Date: 12/06/2003 17:23:00 | Type : Comment |
|
| what do you reproach to my solution ? It should work. It'll build a brand new RAW POST DATA packet for your K script. I don't understand what could be better. |
|||
| By: norbs101 | Date: 12/06/2003 17:26:00 | Type : Comment |
|
| Not my choice... I'm just here to write the mother script for it... And all works great as long as I have access to $http_raw_post_data or php://input... but they both get parsed is variables_order in php.ini contain "p" or contenttype is multipart/form.. |
|||
| By: bljak | Date: 12/06/2003 17:30:00 | Type : Comment |
|
| Ok, to get something straight what kind of datas are going to be submitted? //bljak |
|||
| By: Oliver_Dornauf | Date: 13/06/2003 20:06:00 | Type : Comment |
|
| try an HTTP 307 see <A HREF="http://www.pda-systems.com/form_validation/trail_validation_redirect.html">http://www.pda-systems.com/form_validation/trail_validation_redirect.html</a> |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








