[PHP] QUERY_STRING from command line
Hi, I am working on a php script which is accessed as below http://10.10.10.10/pageone.php?hellohowareyou in the pageone.php i am accessing the variable $_SERVER["QUERY_STRING" and i am getting the proper "hellohowareyou" as value. All these days i was accessing this over the browser. But now i need to POST to this page from command line. When i am usnig the below logic to post to this page, i am not getting any value in the $_SERVER["QUERY_STRING". -- $usepath="http://10.10.10.10/pageone.php";; $host="10.10.10.10"; $data="hellohowareyou"; $fp = fsockopen($host, 80, &$errno, &$errstr, 360); fputs($fp, "POST $usepath HTTP/1.0\n"); $strlength = strlen($data); fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); fputs($fp, "Content-length: " . $strlength . "\n\n"); fputs($fp, "?$data \n\n"); $output = ""; while (!feof($fp)) { $output .= fgets($fp, 1024); } //print " out put is $output aaa "; //exit; fclose($fp); print $output."aaa\n"; Can some one suggest me some solution.. Thanks in advance Regards, Rajesh B. - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone.
[PHP] Input to PHP from Java
Hi, I have a page with SSL enables as below. https://email.website.com/usrfolder/one.php For this page, my customer is posting some XML data using a java output stream as below. ( pseudo code) URL url = new URL(_url); _httpsConnection= (HttpsURLConnection) url.openConnection(); _httpsConnection.setDoInput(true); _httpsConnection.setDoOutput(true); _httpsConnection.setUseCaches(false); _httpsConnection.setRequestProperty("Connection", "Keep-Alive"); // send transaction _outputStream = new DataOutputStream(new BufferedOutputStream(_httpsConnection.getOutputStream())); _outputStream.write(xmlString.getBytes()); _outputStream.flush(); _outputStream.close(); // receive response _inputStream = new DataInputStream(new BufferedInputStream(_httpsConnection.getInputStream())); BufferedReader in= new BufferedReader(new InputStreamReader(_inputStream)); String inputLine ; while ((inputLine = in.readLine()) != null){ rcvMsg = rcvMsg + inputLine; } in.close(); Now the issue for me is , i need to capture the data that is posted by the java code above in my php page. I am not getting the value in any of the standard variables. Can some one suggest me how i should read the data.. Thanks in advance, Regards, Rajesh B. - Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage!
[PHP] XML Signature verification in PHP
HI All, I am getting a xml document from my customer which is signed with XML Signature. Customer is Signing the document with xmlsec library ( parser is libxml2). I have to verify the signature on my side and do the rest of the processing. I saw sevaral examples on the http://www.aleksey.com/xmlsec site for signing and verification. But the problem is all of those examples are in C language. Is there any way, I can do this verification in PHP ? I could not find any API or Sample code in PHP. Regards, Rajesh B. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com