Skip to main content
Participant
November 14, 2010
Question

PHP Question / Help

  • November 14, 2010
  • 2 replies
  • 520 views

I am trying to use a news script using the include function using the instuctions below:

2) Using PHP include() - you can use a PHP include() in any of your PHP pages. Edit your .php page and put the code below where you want the news to be.
<?php include("D:\Hosting\6387712\html\newsscript\installation.phpnews.php"); ?>


But when I do I get the following errors as seen on http://www.abbeyplace.ca

Warning: include(D:\Hosting387712\html ewsscript\installation.phpnews.php) [function.include]: failed to open stream: No such file or directory in D:\Hosting\6387712\html\index.php on line 200


Warning: include() [function.include]: Failed opening 'D:\Hosting387712\html ewsscript\installation.phpnews.php' for inclusion (include_path='.;C:\php5\pear') in D:\Hosting\6387712\html\index.php on line 200

I am truely a noob when it comes to this, so I am sorry if this is a silly question.

Paul

This topic has been closed for replies.

2 replies

November 14, 2010

It looks like a path problem, you are not pointing to the correct location of your include file. Many people will create an includes folder, just like an image folder, to keep all of their include files.  This folder sits in the root directory. So when you call and include, lets call it sample.php, it would look like this:

<?php include ('includes/sample.php');?>

Also, it is a common practice when you create an include file to name it as such: sample.inc.php

HTH

Gary

wbolandAuthor
Participant
November 14, 2010

NVM got it working, thanks.