Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


problem with php

<?php include("inc/products.php"); include("inc/products1.php"); include("inc/products2.php");

i want to run these three files in php, and when i am running it, the php is showing output for the lost one i.e include("inc/products2.php");

how to make the three files to run

2 Answers

include 'inc/products.php'; include 'inc/products1.php'; include 'inc/products2.php';

This should work unless the spelling is wrong, the path is wrong or it could be the capitalization. Products.php is not the same as products.php on some servers where you are running case-sensitive PHP (and I hope you are).

Devin Gray
Devin Gray
39,261 Points

if that doesn't work you could try the "require" command instead of the "include" the command.