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
Bosko Apostolovic
1,601 PointsHELP! php displaying problem in web browser
I have a problem, I just started learning in PHP course. When I write a simple code like:
<h1><?php echo "Shirts 4 Mike"; ?></h1>
<p> The current time is <?php date("h:i:s a"); ?>.
it displays in web browser only:
The current time is .
Can anyone know what a problem is? Greetings.
3 Answers
Hugo Paz
15,622 PointsHi Bosko,
You forgot to echo the result. Try:
<h1><?php echo "Shirts 4 Mike"; ?></h1>
<p> The current time is <?php echo date("h:i:s a"); ?>.</p>
Bosko Apostolovic
1,601 PointsI dont have it. Looks like i didnt installed it. Okay thank you Hugo you are very helpful :)
Hugo Paz
15,622 PointsYou can use treehouse workspaces to try code if you like.
Hugo Paz
15,622 PointsYou can use treehouse workspaces to try code if you like.
Bosko Apostolovic
1,601 PointsOh okay. Thanks one more time :)
Bosko Apostolovic
1,601 PointsBosko Apostolovic
1,601 PointsHi Hugo, Yeah I changed it, but it also shows the same resul. I dont know what the problem is.
Hugo Paz
15,622 PointsHugo Paz
15,622 PointsAre you running it on your machine? Do you have a local server like xampp installed?