Jump to content

java to php


wannabe_god

Recommended Posts

You probably mean JavaScript. Java is quite different from JavaScript, while Java is not a programming language for the internet at all, and JavaScript is :)Yes javascript can pass variables to PHP, and visa versa. You can do so by posting form data to a php file or requesting a php file via GET method (passing variables via the link). There is no other way other than redirecting because php is server-side, and javascript client-side. Javascript can load the php document in a (i)frame, new window, or just in the same window. See how the posting form works:http://www.w3schools.com/tags/tag_form.aspAnd see how you can process its data with php:http://www.w3schools.com/php/php_forms.asp

Link to comment
Share on other sites

no, no, i meant java (that one, from sun :)).<applet sh t></applet>, you know.But Is there a way to connect from java to php? just scores, so only one variable is required, and only once, so maybe I could put it into a database and remove it immedeatly...?

Link to comment
Share on other sites

You probably mean JavaScript. Java is quite different from JavaScript, while Java is not a programming language for the internet at all, and JavaScript is :)

Java can be used in internet, in the applet form. Java can be run by any major browser I know (IE, FireFox, Opera).
can i sent variables/other info from java to php?If yes: howI just want to send the score of the player in a java game (made by me of course) to a php page (coocies?)

I do quess Java can handle cookies. How, that I don't know (I'm not a Java-master-expert though! :) )Check this out BTW.
Link to comment
Share on other sites

You can probably either use Java to create a cookie (if possible), or to load a web page. All it needs to do is send a request. If you can send a request, you can do something like this:

Then have your process page do your database work. But Java can also connect to a database. Or you could also use Java Server Pages.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...