View Full Version : Error testing embeded links on home comp.
kingPhoto
24th of January 2004 (Sat), 23:38
I am using PHPDEV 4.3.0
I get this error when executing snippet1.php in a webpage.
Warning: Failed opening 'http://127.0.0.1/public/gallery/list.php?exhibition=1&pass=public&lang=eng&select_ output=just_thumbs&perpage=5&html=embed_simple' for inclusion (include_path='.;C:/phpdev/php/includes;C:/phpdev/php/class') in c:\phpdev\www\public\gallery\snippet1.php on line 2
If I copy and paste the link into explorer's bar it works fine. Any clues Pekka or anyone else?
Thank you. Pekka what IDE/Editor do you use? I am trying to educate myself some, but time is limited.
-Royce
kingPhoto
24th of January 2004 (Sat), 23:47
Here is what embed_simple.php says:
<?php
$s_ee_html_root = "http://127.0.0.1/public/gallery/";
$html_is_external = "1";
print $javascript_html;
?>
<table border="0" cellspacing="0" cellpadding="0"><tr>
<td>
<?php print $list_html; ?>
</td>
</tr></table>
And here is snippet1.php
<?php
include("http://127.0.0.1/public/gallery/list.php?exhibition=1&pass=public&lang=eng&select_ output=just_thumbs&perpage=5&html=embed_simple");
?>
-Royce
Pekka
25th of January 2004 (Sun), 04:45
In cases like this www.php.net is your friend :)
http://www.php.net/include/
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using an URL (via HTTP or other supported wrapper - see Appendix I 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 an 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.
So, in Windows you have to have at least 4.3.0 to make it work AND have "allow_url_fopen" enabled (it is enabled by default installation) AND in php.in you must have "allow_url_fopen = On"
http://fi2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen
Thank you. Pekka what IDE/Editor do you use? I am trying to educate myself some, but time is limited.
I use Homesite 5 for writing the code (PHP/HTML/MYSQL/JS), and php.net is always opened on the side.
kingPhoto
28th of January 2004 (Wed), 17:07
I deleted the PHPDEV 4.3.0 and installed XAMPP which has the updated php. Everything works now. Yea. Now, I can try creating a front page to the Gallery.
-Royce
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.