Solved

Not able to access pages from another server using require_once

Posted on 2014-04-03
10
389 Views
Last Modified: 2014-04-04
Hello,

I am trying to access pages on another server using require_once.  I have tried:

require_once "http://192.168.0.1/page.php";
require_once "http://www.domain.com/page.php";

If this is possible, what am I doing wrong?

Thanks for your help.

Have a great day,

Don
0
Comment
Question by:GEMCC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39977131
Not, not possible.  When you start the address with 'http', that causes the page to run thru the PHP interpreter on That server.  All you get are the results, not the code.  That will even happen if you try to 'require' (or 'include' or any other method) a page on your own server thru 'http'.
0
 

Author Comment

by:GEMCC
ID: 39977136
So can it be done?
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39977138
Not, not possible.
So can it be done?
https://www.youtube.com/watch?v=BKorP55Aqvg#t=154
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:GEMCC
ID: 39977172
What's up with the video?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39977257
All you will get are the results of the PHP page, not the PHP code.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39977830
You might try copying the file to your server.  You can use file_get_contents() and file_put_contents() to see what that gives you.  

But the question is really strange.   This is a terrible and unacceptable security exposure.  Why in the world would you trust another server to have your application code?  Nobody does something like that -- it's like leaving your children at a stranger's house.  

I recommend you find another solution.  If you can tell us in plain language (business reasons) why you want to do this, maybe we can suggest a "best practices" approach to the business problem.
0
 

Author Comment

by:GEMCC
ID: 39978098
Ray,

Why am I trying this?  Actually it is because I left you results per http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28398396.html a week ago and have not heard from you or anyone else to resolve my real issue so I am trying to be creative.,

Have a great weekend


Don
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39978284
I don't get how this design is related to email, and I'm sorry that I can't debug something on your server, but sometimes even the Experts just come to a dead end.  When it's a question with an answer, we're usually pretty good.  When it's a research project on a computer we can't access, we're not as effective.

Do you have a PHP user group in your area?  Often you can get hands-on assistance in an environment like that.  Maybe check Meetup.com?
0
 

Author Comment

by:GEMCC
ID: 39978359
Never mind.  Thanks.
0
 

Author Closing Comment

by:GEMCC
ID: 39978363
Answered my question, kind of.
0

Featured Post

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 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