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 Basic PHP Website (2018) Adding a Basic Form Concatenation

Baur Alzhanov
Baur Alzhanov
7,028 Points

Why my method isn't correct for checking in challenge

<?php

$title = "Dr."; $firstName = "David"; $lastName = "Bowman"; $fullName = $title . " " . $firstName . " " . $lastName . "!'";

echo "The lead character from 2001: A Space Odyssey '... is named " . $fullName;

?> ///* In Preview I see result

index.php
<?php

$title = "Dr.";
$firstName = "David";
$lastName = "Bowman";
$fullName = $title . " " . $firstName . " " . $lastName . "!'";

echo "The lead character from 2001: A Space Odyssey '... is named " . $fullName;

?>

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Baur.

You're almost there. You codes is syntactically correct, but just not exactly what the challenge is requesting. Challenges are very picky and very strict when it comes to the content it's expecting.

  1. You have added the "!" mark to the variable fullName instead of the concatenated sentence, so that need to be moved down there.

  2. When you deleted the underlines in the sentence, you added an ellipses which was not asked for. The sentence has to read exactly as the challenge is asking, otherwise the code checker will see it as a Bummer!

Just fix up those two things and you're good to go. Let me know if you have further issues. :)

:dizzy:

Baur Alzhanov
Baur Alzhanov
7,028 Points

Thank you for your answer. I can added right code.