superninja Posted June 13, 2006 Share Posted June 13, 2006 Hi little buddies [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] I have a small problem,i made a simple site,with header.html , footer.php and menu.php and index.php.When i browse the site i launch this error:[code]Warning: include(.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\xampp\xampp\htdocs\index.php on line 18Warning: include() [function.include]: Failed opening '.php' for inclusion (include_path='.;C:\xampp\xampp\xampp\php\pear\') in C:\xampp\xampp\xampp\htdocs\index.php on line 18[/code]Here is the index.php file[code]<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"><title>Увод в PHP - 5</title></head><body><?phprequire("header.html");?><table width="95%" cellspacing="15" cellpadding="5" border="0"><tr><td valign="top" width="120"><?phprequire("menu.php")?></td><td valign="top"><?phpinclude ("p.html"); ?></td></tr></table><?phprequire("footer.php");?></body></html> [/code]the header.html[code]<h1 style="font:bold 2em sans-serif;color:#3300FF;text-align:center;">My site</h1> <br> [/code]the menu.php[code]<p align="center" style="font:bold 1em sans-serif;color:#000099"><a href="index.php?p=main">main</a><br><a href="index.php?p=once">information</a><br></p> [/code]once.php [code]<h2 style="font:1.5em serif;color:#cc0000;">Избягване на повторенията</h2><p style="font:.9em sans-serif;color:#000000">Понякога, при по-сложни включвания на файлове един в друг, може да се получи неколкократно повтаряне на кода на един и същи файл.</p><p style="font:.9em sans-serif;color:#000000">Това най- често води до грешки - или в обработката или в логиката на изпълнението..................</p> [/code]and finally index.php[code]<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"><title>Увод в PHP - 5</title></head><body><?phprequire("header.html");?><table width="95%" cellspacing="15" cellpadding="5" border="0"><tr><td valign="top" width="120"><?phprequire("menu.php")?></td><td valign="top"><?phpinclude ("p.php"); ?></td></tr></table><?phprequire("footer.php");?></body></html> [/code] Quote Link to comment https://forums.phpfreaks.com/topic/11861-problem-with-simple-web-page/ Share on other sites More sharing options...
joquius Posted June 13, 2006 Share Posted June 13, 2006 where's p.html Quote Link to comment https://forums.phpfreaks.com/topic/11861-problem-with-simple-web-page/#findComment-44981 Share on other sites More sharing options...
superninja Posted June 13, 2006 Author Share Posted June 13, 2006 [!--quoteo(post=383226:date=Jun 13 2006, 07:25 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 13 2006, 07:25 AM) [snapback]383226[/snapback][/div][div class=\'quotemain\'][!--quotec--]where's p.html[/quote]Ops sorry that was a spelling mistake.its include ("p.php"); Quote Link to comment https://forums.phpfreaks.com/topic/11861-problem-with-simple-web-page/#findComment-44986 Share on other sites More sharing options...
Ninjakreborn Posted June 13, 2006 Share Posted June 13, 2006 sounds to me like your not pointing the includes to the right filepaths, make sure they match, it's telling you it can't find them. Quote Link to comment https://forums.phpfreaks.com/topic/11861-problem-with-simple-web-page/#findComment-44999 Share on other sites More sharing options...
mark s Posted June 13, 2006 Share Posted June 13, 2006 require("menu.php")looks like its missing a ; at the end too. Quote Link to comment https://forums.phpfreaks.com/topic/11861-problem-with-simple-web-page/#findComment-45030 Share on other sites More sharing options...
Ninjakreborn Posted June 13, 2006 Share Posted June 13, 2006 Youfound that problem it looks like, good eye. Quote Link to comment https://forums.phpfreaks.com/topic/11861-problem-with-simple-web-page/#findComment-45031 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.