[PHP] Re: PHP and SSL Path Reference

2003-12-29 Thread Matt Grimm
In response to your first problem:

As long as allow_url_fopen is enabled in php.ini, you can use HTTP and FTP
URLs with most of the functions that take a filename as a parameter. In
addition, URLs can be used with the include(), include_once(), require() and
require_once() statements. 

http://us3.php.net/manual/en/features.remote-files.php

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

D.H. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 PROBLEM 1
 I am trying to implement SSL with PHP.  When trying to use the include()
 function
 to insert an external PHP file, I am only able to make it work in the
local
 directory
 and without SSL.

 I believe the following calls to external files should be correct;
 however, the include function is not successfull with the complete
 URL.

 Example
 include ('test.php'); works fine
 include ('http://www.myURL.com/mySubdirectory/test.php');
 does not work.

 RELATED PROBLEM 2
 When emplementing the SSL I am using my IP's certificate.  Using their
 certificate, I can
 establish an SSL connection directly...ie.
 https://www.myIPDomain.com/myLoginID/mySubdirectories/test.php
 inserted into my browser establishes an SSL connection and the php test
 script works fine.

 When I reference this test script from another PHP script using the
 include() or require() function, the
 script does display the contents of the reference.  The code is as
follows:


 File 1 with external reference:
 https://www.myIPDomain.com/myLoginID/mySubdirectories/testinclude.php

 File 1 Contents:
 ?PHP
 echo Following should be the display of the Test File;
 include
 'https://wwwmyIPDomain.com/myLoginID/mySubdirectories/testinclude.php;;
 ?

 File2 (file I am trying to include):
 https://www.myIPDomain.com/myLoginID/mySubdirectories/test.php

 Contents:
 ?PHP
 echo bbrbrThis is the contents of the Test PHP Fileb;
 ?

 When I call File 1, I can only get the following output:

 Following should be the display of the Test File

 I think it is a matter of relative vs absolute references...but not sure.

 Using the following setup
 Hardware -- SunOS www1 5.7 Generic_106541-12 sun4u
 Apache ver 1.3.26
 PHP ver 4.3.1

 Any suggestions are appreciated...

 Regards,

 D.H.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP and SSL Path Reference

2003-12-29 Thread Manuel Lemos
Hello,

On 12/29/2003 06:37 PM, D.H. wrote:
PROBLEM 1
I am trying to implement SSL with PHP.  When trying to use the include()
function
to insert an external PHP file, I am only able to make it work in the local
directory
and without SSL.
I believe the following calls to external files should be correct;
however, the include function is not successfull with the complete
URL.
Example
include ('test.php'); works fine
include ('http://www.myURL.com/mySubdirectory/test.php');
does not work.
I am not sure why you want to do this because it is very slow. Anyway, 
if you do not allow to open remote URL files in your configuration file 
php.ini, that may be the reason.

You may also want to this HTTP client class that can work if you have 
configuration restrictons. It lets you retrieve pages with either http 
or https URLs.

http://www.phpclasses.org/httpclient


RELATED PROBLEM 2
When emplementing the SSL I am using my IP's certificate.  Using their
certificate, I can
establish an SSL connection directly...ie.
https://www.myIPDomain.com/myLoginID/mySubdirectories/test.php
inserted into my browser establishes an SSL connection and the php test
script works fine.
When I reference this test script from another PHP script using the
include() or require() function, the
script does display the contents of the reference.  The code is as follows:
File 1 with external reference:
https://www.myIPDomain.com/myLoginID/mySubdirectories/testinclude.php
File 1 Contents:
?PHP
echo Following should be the display of the Test File;
include
'https://wwwmyIPDomain.com/myLoginID/mySubdirectories/testinclude.php;;
?
File2 (file I am trying to include):
https://www.myIPDomain.com/myLoginID/mySubdirectories/test.php
Contents:
?PHP
echo bbrbrThis is the contents of the Test PHP Fileb;
?
When I call File 1, I can only get the following output:

Following should be the display of the Test File

I think it is a matter of relative vs absolute references...but not sure.
I think you are confused. When you ask for remote data that way, you 
will get the contents of the page that is generated by that script, not 
the script itself. If you could do what you want that way, anybody could 
steal the PHP source code of all sites.

OTOH, if you have PHP script source code retrieval support enabled, you 
can try what you want asking for this url (notice phps extension), but 
you have to enable support in your server.

https://www.myIPDomain.com/myLoginID/mySubdirectories/test.phps



--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php