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

Code Challenge: Server Paths and Constants (3 of 3)

I know this might seem trivial, but I could use some help in trying to display the value of this variable within this HTML line of code:

Challenge: The name of the owner of the company is in a variable called “owner”. Replace the question marks in the code below with the owner’s name. (Be sure to leave the space between the colon and the name intact, along with all the other HTML.)

My Code: <?php include("../../config/company.php"); ?> <html> <head> <title>Leadership | Shirts 4 Mike</title> </head> <body>

<h1>Leadership</h1>

<p><strong>Owner:</strong> . $owner</p> this is the line in question <p><a href="/contact/">Contact</a></p>

</body> </html>

3 Answers

<p><strong>Owner:</strong> ????</p>    

you must write a small piece of php code that will replace the question marks***

your code must print the variable called “owner”. the print function of php is the echo

I would like to thank you for your response. However, I fully understand the task in theory, I am just having a hard time getting it to work:

echo "<p><strong>Owner:</strong></p>" . $owner; ?> *doesn't seem to work*

<p><strong>Owner:</strong> <?php echo "Owner:" . $owner;?></p>        

The code you've written prints correctly the variable but it prints twice the word 'Owner:'
your php code does not need to print the word 'Owner:'
must print the space between the colon and the name intact ===>" "
and the variable ===> $owner.
So:

<p><strong>Owner:</strong><?php echo " ".$owner;?></p>    

Hey Thanks Hlias, After your example, it hit me like "a ton of bricks"...LOL...thanks, once again.