473,421 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

Need Dual PHP - Java Servlet Problem Solution

I have a PHP script that will be doing an @fopen file open command to
a Java servlet, sending content via a query string.

Problem is that it appears the Java servlet does not receive anything
via its doGet() method and does no action.

Has anyone here successfully ever sent anything via PHP to a Java
servlet? Tell me what you are supposed to do, I thought it was this
simple:

[PHP]
$fileID = @fopen("$SERVLET_SELF/ppowell.ChatServlet?message=" .
urlencode($message) . '&nickname=' . urlencode($_COOKIE['val_chat']),
'r');
[/PHP]

I checked using both echo and print_r() to verify that $message and
$nickname are both populated. I perform this very similar action in
another PHP script and the servlet receives with no problem.

I could use some help from someone well versed in both PHP and Java
Servlets.

Thanx
Phil
Jul 17 '05 #1
3 2754
Hi Phil,

If you're going to be integrating Java Servlets with PHP on a regular basis
or for a production application, consider using the PHP Java Servlet API:

http://www.php.net/manual/en/ref.java.php#java.servlet

Cheers,
Robert
--
Robert Peake | Peake Professional Consulting
Ro****@PeakePro.com | http://www.peakepro.com/

Jul 17 '05 #2
Thanx, I will look into that, however, I am unclear as to its current
stability since according to the PHP manual on www.php.net it is still
labeled "experimental".

Phil

Robert Peake <ro****@peakepro.com> wrote in message news:<BC7A23F0.2729%ro****@peakepro.com>...
Hi Phil,

If you're going to be integrating Java Servlets with PHP on a regular basis
or for a production application, consider using the PHP Java Servlet API:

http://www.php.net/manual/en/ref.java.php#java.servlet

Cheers,
Robert

Jul 17 '05 #3
Has anyone here successfully ever sent anything via PHP to a Java
servlet? Tell me what you are supposed to do, I thought it was this
simple:

[PHP]
$fileID = @fopen("$SERVLET_SELF/ppowell.ChatServlet?message=" .
urlencode($message) . '&nickname=' . urlencode($_COOKIE['val_chat']),
'r');
[/PHP]


What is stored in your $SERVLET_SELF variable?
In this case, fopen will work if $SERVLET_SELF contains a full HTTP-path to
your servlet., e.g. http://domain.com/ppowell.ChatServlet? ......

--
Vasiliy
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Morgan | last post by:
I'm trying to get php to run on my webserver as a Java Servlet, it works the first time but fails the second time and crashes the JVM with the following error: I have tried the latest versions...
1
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
0
by: Angelos | last post by:
Hello on my second post ! As I said I am new to the servlets development and almost new in Java. I've done a bit of java in uni but I continued working on PHP and I don't remember a thing from...
0
by: TraceyAnnison | last post by:
I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis. We have a Java project built with the Spring framework, in order to...
0
by: ErikaW | last post by:
Hi all, I've tried to google this but could not find a clear solution. I have a Web application developed in JDevloper using mostly html and Javascript. I have a pre-defined PDF form which I merge...
2
by: vijaykumardahiya | last post by:
Hello Sir, I have a simple Issue but It is not resolve by me i.e input parameter are not store in Ms-Access. I store the input parameter through Standard Action <jsp:useBean>. jsp:useBean call a...
9
by: mjahabarsadiq | last post by:
Hi I have created a servlet that is to be started at the server startup. And I got it. In that I have created a object of another class and set it as a session attribute. What I am trying is...
7
by: swethak | last post by:
Hi, i have a command to convert the video file into image ffmpeg -i sample.wmv -f image2 -t 0.001 -ss 3 ss.jpg i run that one in command prompt it converted the video file into...
2
by: ramprakashjava | last post by:
This is index.jsp page code: <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.