visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: Recreate raw POST data.?


By: norbs101 U.S.A.  Date: 12/06/2003 00:00:00  English  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 English  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 English  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 English  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 English  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 English  Type : Comment
APL... souvenirs, souvenirs...
By: VGR Date: 12/06/2003 04:59:00 English  Type : Comment
well, then don't pass anything to PHP but pass it to K ;-)
By: norbs101 Date: 12/06/2003 17:02:00 English  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 English  Type : Comment
and why do you use K then?

//bljak da unKnown
By: VGR Date: 12/06/2003 17:23:00 English  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 English  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 English  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 English  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

EContact
browser fav
page generated in 374.688860 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page