Hi,
I need help.
When I use <frameset> I can open diferent pages from diferent web servers. Something like:
<frameset rows="64,*">
<frame name="banner" target="contents">
<frameset cols="150,*">
<frame name="contents" target="main" src="content.html">
<frame name="main" src="http://www.omnitel.lt">
</frameset>
....
I don't want use frameset.
How can I make similar with phpscript?
This work bad:
<? include "head.inc";
include "http://www.omnitel.lt";
include "end.inc";
?>
Where is my mistake?
include
Moderator: General Moderators
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
It could be that html://www.omnitel.lt does not exist. (may be http://www.omnitel.It/index.php" at a guess).
You may also need to check the configuration settings...
The manual states....
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Appendix L for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.
Warning
Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled.
This means that include is not the best thing. Look into readfile
You may also need to check the configuration settings...
The manual states....
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Appendix L for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.
Warning
Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled.
This means that include is not the best thing. Look into readfile
I know manual. My script work, but not how I expect.
When i try adress http://www.omnitel.lt/?m3_lt$205592_206051 from Internet explorer, page is O.K.
When I try open this page from my file.php, page is not correct.
<? include "http://www.omnitel.lt/?m3_lt$205592_206051"; ?> - include without pictures, menu scripts, css files. Links on that opened page work not correct.
I need "result page" from remote server, not "text" from page.
When i try adress http://www.omnitel.lt/?m3_lt$205592_206051 from Internet explorer, page is O.K.
When I try open this page from my file.php, page is not correct.
<? include "http://www.omnitel.lt/?m3_lt$205592_206051"; ?> - include without pictures, menu scripts, css files. Links on that opened page work not correct.
I need "result page" from remote server, not "text" from page.
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
In general you cannot access a php script from another site. All you can get is the HTML content. If you were able to get the script you could also get other details such as database passwords etc.
The solution is for the file on the required url to set full pathnames rather than relative ones. e.g
rather than
The same with links.
To add information, you would then only need to strip out the body of the text (storing any necessary css/javascript file links included within the <head> block which you would then need to also include in your head block).
All other alternatives require close cooperation with the target url creators. An example being an XML Feed etc.
The solution is for the file on the required url to set full pathnames rather than relative ones. e.g
Code: Select all
<img src="http://www.site.com/img/myimage.jpg">Code: Select all
<img src="img/myimage.jpg">To add information, you would then only need to strip out the body of the text (storing any necessary css/javascript file links included within the <head> block which you would then need to also include in your head block).
All other alternatives require close cooperation with the target url creators. An example being an XML Feed etc.