Calling PHP scripts from JSP?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
cedricdj
Forum Newbie
Posts: 4
Joined: Thu Apr 13, 2006 9:19 am

Calling PHP scripts from JSP?

Post by cedricdj »

Hi,

is there a simple way to call PHP scripts with some GET parameters from JSP? I would also need to get some information back, though it will be very simple and could be done using the PHP's standard output. The PHP and JSP scripts will be running on the same machine, the PHP scripts through Apache and the JSP ones through Tomcat.
I have no need to share more data than the GET parameters and return string mentioned above.

Thanks,

Cédric.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Is it not possible to do what you wish solely in JSP? It would be odd if it were not.
cedricdj
Forum Newbie
Posts: 4
Joined: Thu Apr 13, 2006 9:19 am

Post by cedricdj »

What I'm doing is integrating phpBB in an existing JSP project, which require a little communication between the two (mainly keeping the two user databases synchronised). Sure, I could rewrite a JSP-based forum, but that sounds like a lot more work ;)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why not write the sync code in JSP? All it would be is some database interaction, the scripting language used is generally irrelevant.
cedricdj
Forum Newbie
Posts: 4
Joined: Thu Apr 13, 2006 9:19 am

Post by cedricdj »

That would be an option, and I will do that if the integration idea fails.

However I would like to leave the JSP side of the framework with as little modifications as possible, and keep as much as possible of the forum-related code on the PHP side.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

this http://jguru.com/faq/view.jsp?EID=104987 might be of help. They are talking about POST, GET should be even simplier.
cedricdj
Forum Newbie
Posts: 4
Joined: Thu Apr 13, 2006 9:19 am

Post by cedricdj »

That looks very much like what I need! Indeed, looking through their code adapting it to GET parameters should be easy.

Thanks!
Post Reply