?
Solved

Get dynamic content from a server where PHP is not installed

Posted on 2007-10-20
12
Medium Priority
?
228 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:Wongy
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 1200 total points
ID: 20115537
> - No server-side scripting is allowed on Server2, thus you can only get static web pages.
this include php, yes?. If server2 can't run any scripting language you could try a proxy (like mod_proxy) from apache (if that isn't also possible you can't get any dynamic content on server2, as the server has only static capabilities.
0
 
LVL 13

Expert Comment

by:MasonWolf
ID: 20115541
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.
0
 
LVL 1

Author Comment

by:Wongy
ID: 20115907
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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 51

Expert Comment

by:Steve Bink
ID: 20115915
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.
0
 
LVL 1

Author Comment

by:Wongy
ID: 20116186
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.
0
 
LVL 51

Expert Comment

by:Steve Bink
ID: 20116212
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.
0
 
LVL 1

Author Comment

by:Wongy
ID: 20116260
I cannot use CURL nor mod_proxy on Server2.
0
 
LVL 51

Assisted Solution

by:Steve Bink
Steve Bink earned 300 total points
ID: 20116284
That's a problem.  I know of no other methods to accomplish this.  Are those options limited by your host?  If so, perhaps a new host would be in order.  A host without PHP (with or without CURL) does not seem to be much of a host.

Can you redirect your traffic to server1?  You stated your users do not have access to it...why not?
0
 
LVL 13

Expert Comment

by:MasonWolf
ID: 20116318
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.
0
 
LVL 48

Expert Comment

by:hernst42
ID: 20117109
> 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.
0
 
LVL 1

Expert Comment

by:jmcfeed
ID: 20118017
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
0
 
LVL 1

Author Comment

by:Wongy
ID: 20549541
It indeed does not seem to be possible...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question