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 trialanonymousperson
8,573 PointsMy localhost is not showing anything
I type exactly the same thing. But my browser does not show anything, it was just blank. Somebody can help me?
9 Answers
Stone Preston
42,016 Pointsit looks like you have an incorrect php tag. you need to use <?php
as the open tag not <? php
try using this code:
<!DOCTYPE html>
<html>
<head>
<title>Shirts 4 Mike</title>
</head>
<body>
<h1>Shirts 4 Mike</hi>
<p>©<?php echo date('Y'); ?> Shirts 4 Mike </p>
</body>
</html>
then save the file and try again
Stone Preston
42,016 Pointsdid you save your file?
anonymousperson
8,573 PointsYes
Stone Preston
42,016 Pointscan you post the filename and the extension, the directory your file is in, the address you are visiting in the browser, and the code from your file please
anonymousperson
8,573 PointsHow to post?
Stone Preston
42,016 Pointsjust type the name of your file, the directory your file is in, and the address you are visiting in a comment. and copy and past your code in as well
anonymousperson
8,573 Pointstest.php is my file name. It is in my htdocs inside the MAMP file in application. http://localhost/test.php.
Code is here: <!DOCTYPE html> <html> <head> <title>Shirts 4 Mike</title> </head> <body> <h1>Shirts 4 Mike</hi> <p>©<? php echo date('Y'); ?> Shirts 4 Mike </p> </body> </html>
anonymousperson
8,573 Points<!DOCTYPE html>
<html>
<head>
<title>Shirts 4 Mike</title>
</head>
<body>
<h1>Shirts 4 Mike</hi>
<p>©<? php echo date('Y'); ?> Shirts 4 Mike </p>
</body>
</html>
anonymousperson
8,573 PointsWhy is my code not showing up here? It isn't the right code. :( Sorry, I'm not sure why? but it delete of the html head and other elements.
Stone Preston
42,016 Pointsyou have to format code in the forum to make it show up. see this forum post for how to do that. I formatted your code for you so it should show up now
anonymousperson
8,573 PointsThank you so much!!! Argh I'm so dumb. Sorry to trouble you. Should we be friends or something like that? haha :)
Stone Preston
42,016 Pointshaha no worries. dont feel bad, stuff like that happens all the time.
anonymousperson
8,573 PointsHaha Thanks A lot. This forum is great!!! I don't have to wait for long time. Once again, Thank you so much!!! Thanks for the help!!! I will try to be more careful in the future :D!!! Thanks!!!