0

Here's what I would like to do.

I have a PHP file in my server where I would like to call java applet. The applet function will send a get request to read a page from third party server. Now I want page read from applet function to be sent to PHP script. To simply put ,i want the return value of the applet request function in a PHP variable. Is it possible to do?

I want to do this way because I already have the code to parse the page information in PHP, so I don't want to rewrite that in java again.

I wanted the Java applet because the request has to be sent using the client information like IP. So I don't want to use proxies.

Note: I am not trying to hack anyone's server. I am not a advanced programmer of either Java or PHP. Please reply me in a descriptive manner possibly with pseudo code.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Questions
  • 195
  • 1
  • 14

1 Answers1

1

I already have the code to parse the page information in PHP, so I don't want to rewrite that in java again.

PHP should be able to get that page more easily than can a Java applet. The applet would need to be trusted or in communication with a site that uses the 'cross-domain resources' file that explicitly allows hot-linking.

Searches on 'php proxie' seemed to spill out around 7.32 million hits. I'd start there.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • Thanks for the reply. I wanted the java applet because the request has to be sent using the client information like IP. So I don't want to use proxies. – Questions Aug 04 '12 at 06:06
  • What is an URL where can we see a page from this 'third party server'? – Andrew Thompson Aug 04 '12 at 06:08
  • i just mentioned it as third party server to intend a different server altogether. It may be pointed to .txt file of my own different server. So from my site 1 users login and upon authentication I get the data from my site 2. – Questions Aug 04 '12 at 06:12
  • Note that interacting with a secure server is a whole different thing to simply 'getting a web page' from a remote site. – Andrew Thompson Aug 04 '12 at 06:13
  • Yeah I know that this isn't a secure way to do it. But to start with I thought of going with this method and like to know how this can be made possible. – Questions Aug 04 '12 at 06:15
  • *"It may be pointed to.."* So give me **one** URL that requires me to send an IP to get access. For testing, if nothing else. – Andrew Thompson Aug 04 '12 at 06:18
  • Right now I don't have or couldn't think of such url in place. It's not about just IP. I want to have some user information before they access anything from my server. Direct linking of those txt files will be prohibited and user will just login once in my site 1 to get content from site 2. – Questions Aug 04 '12 at 06:24