Link to home
Start Free TrialLog in
Avatar of Wongy
WongyFlag for Belgium

asked on

Get dynamic content from a server where PHP is not installed

Hi,

This is the situation:
I have a server let's say Server1, located at www.server1.com, and another one called Server2, located at www.server2.com (the domain names are fictitious).

- PHP is installed on Server1.
- No server-side scripting is allowed on Server2, thus you can only get static web pages.
- My users do not have access to Server1, but only to Server2.

Now, my question is: how, by posting data on Server2, can the users get dynamically generated pages from Server1 via Server2?

Thanx for your help.
Let me know if this is not clear.
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use an iframe? Alternately you could maybe include a php-written javascript page like so:
<script type="text/javascript" src="http://server1.com/dynamicjs.php"></script>

Then just use the document.write method to display your dynamic content.
Avatar of Wongy

ASKER

MasonWolf:

Your proposal wouldn't work since the users do not have access to Server1. Even if the following code is located on Server2: <script type="text/javascript" src="http://server1.com/dynamicjs.php"></script>, once loaded on the user's computer, this will try to get a direct connection to Server1, which is forbidden.
Avatar of Steve Bink
What data are you posting on server2?  Is it data inside a database, which is used to build a dynamic page?  Or are you talking hosting source files on server2 without the ability to parse them on server2?

Please provide an example of what data would be on server1 and server2, and how they should interact.
Avatar of Wongy

ASKER

routinet:

The posted data would indeed be used to get information from a database (on Server1) and to build a dynamic page.

It could be that the dynamic page is generated on Server1, converted to an HTML file, transferred to Server2 and then to the user's computer... Something like that.

Hope it's clearer.
OK, so you want to use a remote proxy style of system, as hernst42 mentioned.  He was looking at it through mod_proxy, but you could do the same thing through the CURL library within PHP.  Are you familiar with either method?

mod_proxy would probably be cheaper in terms of system resources with heavy loads...I would recommend looking at that one first.
Avatar of Wongy

ASKER

I cannot use CURL nor mod_proxy on Server2.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are any types of connections to Server 1 allowed? If so, what types?

I suppose you might be able to embed a Java applet that uses a JDBC object to connect to your database (mysql, I assume) on Server 1. I've done that before, though it's been a while.
> I cannot use CURL nor mod_proxy on Server2.
In this case you can't use and dynamic content at all. You need at least  a proxy or scripting language on server2 to accomplish that. Sorry but with that limitations on server2 there is no solution for your question.
Avatar of jmcfeed
jmcfeed

Is SSI installed on Server2?
If it is, try to use it to execute scripts from Server1, and then to show them to user.
If it doesn't work, you could gather the page directly by using SSI

This is an example you could use to execute CGI code:
<!--#exec cgi="http://www.server1.com/documentToInclude.php"-->

Not working? Try the following to include a remote page:
<!--#include file="http://www.server1.com/file.php"-->ç

Hope this will help.

Regards,

jmcfeed
Avatar of Wongy

ASKER

It indeed does not seem to be possible...