![]() |
Java and Web Pages
I've got this java program which needs to be able to enter data in a textbox on a web page. Shown below,
http://home.cogeco.ca/~ebelec/pic/ex2.jpg Is there a way that I'd be able to enter data in the textBox (marked 'something') and then hit the "Submit Query" button without the user seeing me do this? I'm doing this because on that web page a PHP program will run and calculate a highscores list for my game. Does Java have this sort of capability? |
Learn the name of the fucking programming language you're using before you ask questions.
|
Quote:
|
I think uman is refering to the fact that you may be confusing Java and JavaScript, two completely different languages.
|
Quote:
|
If your using a java applet then surely this would not be difficult. You would have the text box and button in the applet, then you can do what ever you want with them.
But if you want php and java to send data to each other then i think its probably impossible. But i could be wrong. I think you should go find out what java applets can really do, and then find out that there are easier ways. I dont quite understand why you want to do what you are doing? Maybe if you explain with some code and more detail people wount swear at you. |
Sorry, I assumed you were confusing Java with JavaScript like countless retards who come in here. My apologies.
|
Not a problem.
Here's the html code for the page: :
<html>Here is action.php called by the main page (which is irrelevant to the java program) but you asked for it here it is. :
html> |
You want to take a look at how HTML forms work. When you hit the submit button the information in the textbox is packed into a url and sent to the webserver by your web browser. All you have to do is make that URL programatically instead of having the web browser generate it.
I am not sure but I think the URL looks something like below :
http://www.mywebpage.com/mypage?myTextField=10Edit, I saw your new post: What you have to do is submit an html POST request and I believe the url should be: :
http://www.thewebpage/page?strname=198EDIT: Updated the the last edit for clarity. |
Thanks Game Ender. I'll try it out.
|
| All times are GMT -5. The time now is 2:58 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC