Jump to content

Archived

This topic is now archived and is closed to further replies.

essjay_d12

include("site.php") not working!

Recommended Posts

I havhttp://www.phpfreaks.com/forums/style_images/1/folder_rte_images/bold.gif
Bolde the following file....

accessKey.php and also tried accessKey.html

[code]
<A accesskey="S"
rel="Advanced Search" href=
"http://localhost/dvdreviewer/advancedSearch.php"
></A>
<A accesskey="H"
rel="Home" href=
"http://localhost/dvdreviewer/default.php"
></A>
[/code]

And then in my default.php file (and planned for every other page on the site)

i have ....

[code]
<body>
<?php include("http://localhost/dvdreviewer/accessKey.php"); ?>

.....code

</body>
[/code]

This at the moment brings back errors on the default.php page...

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Warning: main(http://localhost/dvdreviewer/accessKey.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\Program Files\Apache Group\Apache2\htdocs\dvdreviewer\default.php on line 19

Warning: main(): Failed opening 'http://localhost/dvdreviewer/accessKey.php' for inclusion (include_path='.;c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\dvdreviewer\default.php on line 19
[/quote]

Anyone know why?

Thanks

D

Share this post


Link to post
Share on other sites
i don't think that you can use URL's when including.
you need to specify the path in either of two ways:

relative to the file you have the include in:
include('../scripts/myscript.php');

or relative to the site:
include($_SERVER['DOCUMENT_ROOT'].'/scripts/myscript.php');

paths accepted in include are the full server paths, not URL's.

try it

Cheers
Mark

Share this post


Link to post
Share on other sites
still getting errors though .. changed it to both

the following error for .. <?php include('../dvdreviewer/accessKey.html'); ?>

.....

Warning: main(C:/Program Files/Apache Group/Apache2/htdocs/dvdreviewer/accessKey.html): failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\dvdreviewer\default.php on line 469

Warning: main(): Failed opening 'C:/Program Files/Apache Group/Apache2/htdocs/dvdreviewer/accessKey.html' for inclusion (include_path='.;c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\dvdreviewer\default.php on line 469

Share this post


Link to post
Share on other sites
[!--quoteo(post=358274:date=Mar 25 2006, 05:19 PM:name=Essjay_d12)--][div class=\'quotetop\']QUOTE(Essjay_d12 @ Mar 25 2006, 05:19 PM) [snapback]358274[/snapback][/div][div class=\'quotemain\'][!--quotec--]
still getting errors though .. changed it to both

the following error for .. <?php include('../dvdreviewer/accessKey.html'); ?>

.....

Warning: main(C:/Program Files/Apache Group/Apache2/htdocs/dvdreviewer/accessKey.html): failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\dvdreviewer\default.php on line 469

Warning: main(): Failed opening 'C:/Program Files/Apache Group/Apache2/htdocs/dvdreviewer/accessKey.html' for inclusion (include_path='.;c:\php4\pear') in C:\Program Files\Apache Group\Apache2\htdocs\dvdreviewer\default.php on line 469
[/quote]

are you 100% that accessKey.html is:
a) in the dvdreviewer folder
b) in the same case as you're specifying? most things like this are case sensitive.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.