PHP to Java
Posted on 2003-11-19
We have a credit card interface written in PHP and our cc processor written in Java. What I want is to read the data from the PHP interface, pass it onto the Java processor and then readthe result back.
The first solution I thought of is to use HTTP. Convert the java application into a Servlet and have the PHP redirect the flow to the Servlet. This is a possible solution but I am wondering how I could read the result back from the servlet (mind you I haven't got a clue about PHP syntax in order to read the input stream).
The second solution is to use the Java extensions that come with PHP4. The problem here is that the live server is not configured with the Java extensions and I do not know how feasible it would be to take it down, recompile PHP with Java support and then run it.
Also I am not sure how stable this Java extension is.
Also, I found out that in order to do redirection to another page I have to use the header("Location: URL"); code. Does anyone knwo how I can pass variables along with it as well? Something similar to the following in Java
<jsp:forward page="myPage.jsp" >
Any more thoughts on the above two solutions? 500 points and an A answer for good opinions/information.