Jump to content

Need some help with the include statement on xampp 1.7.7


m1k3yb0y

Recommended Posts

Hey guys! I am using xampp 1.7.7 usb edition for my php server and I am trying to include a php file that's different from where I have all my php files at. I have them in: \xampp\htdocs\xampp\RecipeSite. Is there a certain path I should use instead of <?php include('/xampp/splash.php'); ?> to allow for xampp to pick up my file? I appreciate your solutions guys.

it is not detecting the splash image file.

 

By 'it' I assume you mean the browser (browsers request and render the media files on a web page.)

 

Are you using a valid web accessible URL to the splash image file in the HTML markup on your page? You can either use a fully qualified URL - http://somedomain/some_path/some_file.ext (the browser uses the URL directly) or a domain root relative URL - /some_path/some_file.ext (the browser appends the given URL to the domain of the current page) or a (page) relative URL - ../some_path/some_file.ext (the browser appends the given URL to the URL of the current page.)

 

Don't confuse URL's (that browsers use to make HTTP requests for files) with file system paths (that php uses to include files on the server.)

Cannot help you without the code that is responsible for the symptom.

 

Someone already posted the three possible types of URL's to use. It is up to you to make sure that each element in the type of URL that you are using is correct. Usually, the path to the image is incorrect.

Sorry I forgot to post the code. >.<

 

Here it is:

<html>
<body>
<?php include $_SERVER['DOCUMENT_ROOT'] . '/xampp/splash.php'; ?>
<?php include('header.inc.php'); ?>
<br><br>
<h2>This is the body of the main page</h2>
<?php include $_SERVER['DOCUMENT_ROOT'] . '/xampp/manuals.php'; ?>
</body>
</html>

 

Where do I place the url link at on the code?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.