Jump to content

Need some help with the include statement on xampp 1.7.7


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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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