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

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!