Jump to content

include("site.php") not working!


essjay_d12

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
Link to comment
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
Link to comment
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
Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.