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 PHP Basics (Retired) PHP Datatypes Integers

Juliette Tworsey
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,425 Points

Hi, When I hit preview I am getting a blank page with this url: http://port-80-fofumhzvf3.treehouse-app.com

This is my code so far:

<php $name = "Mike"; $location = "Orlando"; $full_name = "Mike The Frog": $name = $full_name;

?>

<!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>Mike The Frog | Treehouse Profile</title> <link href="css/style.css" rel="stylesheet" /> </head>

<body> <section class="sidebar text-center"> <div class="avatar"> <img src="img/avatar.png" alt="<?php echo $name ?>"> </div> <h1><?php echo $name ?></h1> <p><?php echo $location ?></p> <hr /> <p>Welcome to PHP Basics!</p> <hr /> <ul class="social"> <li><a href=""><span class="icon twitter"></span></a></li> </ul> </section> <section class="main"> <pre> <?php $one = 1; $two = 2; $3 = 3;

       echo $one;
     ?>

  </pre>
</section>

</body> </html>

David Pena Abad
David Pena Abad
16,288 Points

Hi Juliette,

I don't know if it is a copy-paste problem, but when you have opened the first php declaration you have forgotten the question mark. You should write: <? php (...) ?>

Too, after the $full_name variable, you have written a colon, but you should write a semi-colon.

See you soon.

4 Answers

Did you "save" the file ? (on the top of the workspace click file>save or >save all) also there what is the name of the file if its not "index.html" you need to add it to the url

http://port-80-fofumhzvf3.treehouse-app.com/php.html

Chanse Campbell
Chanse Campbell
4,453 Points

I just wanted to flag this up that I've also been having this same issue on my Macbook on these videos. The quick fix is I have to manually add index.php to the end of the URL on every workshop preview, but something must be up?

Elena Paraschiv
Elena Paraschiv
9,938 Points

I have the same problem. Does anyone know how to view the index.php page locally. I really want to see how my code is turning. I am using Sublime text editor.