473,666 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("$SERVLE T_SELF/ppowell.ChatSer vlet?message=" .
urlencode($mess age) . '&nickname=' . urlencode($_COO KIE['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 2769
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 "experiment al".

Phil

Robert Peake <ro****@peakepr o.com> wrote in message news:<BC7A23F0. 2729%ro****@pea kepro.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("$SERVLE T_SELF/ppowell.ChatSer vlet?message=" .
urlencode($mess age) . '&nickname=' . urlencode($_COO KIE['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
3470
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 of PHP 4. (release and dev) I would appreciate any help with this issue. -- Chris
1
6912
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
2217
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 Java. So can you tell me if there is anything that a newbie should be carefull ? Should I use Tomcat for example or Application Server that comes with J2EE 1.4 ?
0
2379
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 provide webservices for access via SOAP. As I understand it (ie not very well!) Axis works to accept these SOAP messages from the client and transform them into calls on our Java methods, and do the reverse with the responses - cool! Which is excellent,...
0
2593
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 with a XML file. I want to be able to save the form automatically for the User so as to prevent typing errors i.e. c:/erikaTemp/subFolder/erika_12345.pdf but from what I've seen this can only be done via the the 'File download' pop up which only...
2
3323
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 property IssueData. this property exist in SimpleBean which create a connection from DB and insert the data. At run time servlet and server also show that loggging are saved in DB. But when I open the table in Access. Its empty. Ms-Access have...
9
3171
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 to get the object in a jsp page. Following are the codes.
7
9586
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 image. But i executed that command in jsp Program .It didn't work.It shows error.
2
2651
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 uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> <html:html locale="true"> <head> <html:base/>
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6192
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.