Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Post Data Without a Variable name?

Status
Not open for further replies.

vbkris

Programmer
Jan 20, 2003
5,994
IN
o.k,
i have a flash file that is sending data in POST method to my PHP file. the catch is that the data is not assigned to a variable.

in GET method the query string would look like this:
test.php?Variable=Value

but flash sends it as:
test.php?Value

No variable. If its get method atleast i amy be able to read the location and do something but the method is post. how can i just flush the entire post data?

Known is handfull, Unknown is worldfull
 
the ASP equivalent being:

FormSize=request.TotalBytes
FormData=request.BinaryRead(FormSize)
response.binarywrite(request)
set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.Write FormData
objStream.SaveToFile server.mappath("TheFileName"), 2
objStream.close
set objStream = Nothing


this will save the Post Data to the TheFileName file...

Known is handfull, Unknown is worldfull
 
I don't think you get access to this information, at least not in an apache/php setup.... I'm pretty sure it's just assumed to be malformed and thrown away.

Code:
echo '<pre>';
print_r($GLOBALS);

on your receiving script is the best way I can think of to check for yourself... it's pretty much all the information you have available.
 
You can at least narrow it down..

echo '<pre>';
print_r($_REQUEST);

You might also try just the individual $_POST and $_GET arrays.. sometimes php gets a little tricky when deciding what gets put into $_REQUEST.

-Dustin
Rom 8:28
 
Or how about
Code:
$_SERVER['QUERY_STRING']

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
skiflyer and dustin:
i have just tired ur code, i will see how it can be manipulated.

chessboot:
the GET method was just an example as to how the variables are in the POST method.

i also found a HTTP_RAW_POST_DATA method , but it has got its own bugs...


Known is handfull, Unknown is worldfull
 
hi fellas, found an answer:

$raw_xml = file_get_contents("php://input");


seems to give me the XML...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top