Jump to content


Photo

include("site.php") not working!


  • Please log in to reply
5 replies to this topic

#1 essjay_d12

essjay_d12
  • Members
  • PipPipPip
  • Advanced Member
  • 121 posts

Posted 25 March 2006 - 04:41 PM

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

<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>

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

i have ....

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

.....code

</body>

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/dvd...r/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/dvd...r/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


#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 25 March 2006 - 04:50 PM

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
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 25 March 2006 - 04:53 PM

I was betten there lol
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 essjay_d12

essjay_d12
  • Members
  • PipPipPip
  • Advanced Member
  • 121 posts

Posted 25 March 2006 - 05:19 PM

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

#5 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 25 March 2006 - 05:34 PM

[!--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) View Post[/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.


"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#6 essjay_d12

essjay_d12
  • Members
  • PipPipPip
  • Advanced Member
  • 121 posts

Posted 25 March 2006 - 05:38 PM

its working now !!
thank you very much

d




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users