• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

Not able to access pages from another server using require_once

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
GEMCC
Asked:
GEMCC
  • 5
  • 2
  • 2
  • +1
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
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
 
GEMCCAuthor Commented:
So can it be done?
0
 
Dan CraciunIT ConsultantCommented:
Not, not possible.
So can it be done?
https://www.youtube.com/watch?v=BKorP55Aqvg#t=154
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
GEMCCAuthor Commented:
What's up with the video?
0
 
Dave BaldwinFixer of ProblemsCommented:
All you will get are the results of the PHP page, not the PHP code.
0
 
Ray PaseurCommented:
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
 
GEMCCAuthor Commented:
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
 
Ray PaseurCommented:
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
 
GEMCCAuthor Commented:
Never mind.  Thanks.
0
 
GEMCCAuthor Commented:
Answered my question, kind of.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now