essjay_d12 Posted March 25, 2006 Share Posted March 25, 2006 I havhttp://www.phpfreaks.com/forums/style_images/1/folder_rte_images/bold.gifBolde 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 19Warning: 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?ThanksD Link to comment https://forums.phpfreaks.com/topic/5780-includesitephp-not-working/ Share on other sites More sharing options...
redbullmarky Posted March 25, 2006 Share Posted March 25, 2006 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 itCheersMark Link to comment https://forums.phpfreaks.com/topic/5780-includesitephp-not-working/#findComment-20583 Share on other sites More sharing options...
redarrow Posted March 25, 2006 Share Posted March 25, 2006 I was betten there lol Link to comment https://forums.phpfreaks.com/topic/5780-includesitephp-not-working/#findComment-20586 Share on other sites More sharing options...
essjay_d12 Posted March 25, 2006 Author Share Posted March 25, 2006 still getting errors though .. changed it to boththe 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 469Warning: 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 https://forums.phpfreaks.com/topic/5780-includesitephp-not-working/#findComment-20602 Share on other sites More sharing options...
redbullmarky Posted March 25, 2006 Share Posted March 25, 2006 [!--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 boththe 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 469Warning: 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 folderb) in the same case as you're specifying? most things like this are case sensitive. Link to comment https://forums.phpfreaks.com/topic/5780-includesitephp-not-working/#findComment-20610 Share on other sites More sharing options...
essjay_d12 Posted March 25, 2006 Author Share Posted March 25, 2006 its working now !!thank you very muchd Link to comment https://forums.phpfreaks.com/topic/5780-includesitephp-not-working/#findComment-20614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.