Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Simple PHP Application Wrapping Up The Project Objects

what's wrong?

In this code challenge, we will work with a third-party library that helps us identify palindromic primes. First, at the top of the file, let’s include the third-party library. You can find it at class.palprimechecker.php in the same folder as the file below.

palprimes.php
<?php

include("class.palprimechecker.php/palprimes.php");




echo "The number ## ";
echo "(is|is not)";
echo " a palprime.";

?>

3 Answers

Sara Hardy
Sara Hardy
8,650 Points

Try include("class.palprimechecker.php");

Hi!

The text says "You can find it at class.palprimechecker.php in the same folder as the file below.". The path that you entered in the include() statement is erroneous, because the trailing slash (/) indicates that you are trying to include the "palprimes.php" file located in the "class.palprimechecker.php" directory.

The correct way would be:

<?php
    include('class.palprimechecker.php');
?>

The include() statement will try to include the file (class.palprimechecker.php) that is found in the same directory where the script (palprimes.php) is located.

I hope my explanation has helped you!

thanks, Emiliano Ceccon!