View Full Version : posting client side java to server side php

Nov 11th, 2006, 01:59 PM
Hi there,

ive been searching fro the answer to this problem for about 4 days now and now its becomming rather frustrating. Im wondering if some one can help me...

i have a signature java applet which after it has been used spits out a variable which is a load of x and y co-ordinates. what i want to do with out auccess is either post these directly to a php form or set it up to go to a form so that it can be submitted.

heres the code

<h1>Signature Capture</h1>

<applet name='mysig' code='SigBlock.class' width=301 height=76>
<param name=text value="Signature">
<param name=font value="Arial">
<param name=fontsize value=42>
<param name=fontstyle value="italic">
<param name=fontx value=10>
<param name=fonty value=50>
<param name=appwidth value=200>
<param name=appheight value=75>
<param name=linestyle value=2>

<input type='button' name='sign' value='Sign' onClick='text1.value=mysig.sign();'>

<textarea name='text1' cols='65' rows='20' wrap></textarea>


basically when sign is pressed it dumps the applet varibales to a text area for viewing which is fine, but fro that code does any one know a work around where it can either be submitted directly to a php script or dump as a hidden input field ready for submission with a form.

and ideas would be great


Nov 11th, 2006, 05:52 PM
I am not sure about submitting data from an Applet to form without making a call to the server. If someone knows of a way do it without making a call to the server...I would be interested to know how as well :) .

Anyway...since you want to pass the data from an applet to a php variable I would suggest that you instantiate an instance of the URL (http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html)class and establish a connection to the server that way.

In any case...there are loads of examples on Sun Microsystem website on how to use the URL class...

If you need help with that...just drop us a line and will try and help.