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 Functions Introducing Functions Introducing Functions

PHP development workspace preview not working?

When I go to launch my workspace in the browser I get a blank page with nothing on it. Could someone explain why this is happening please?

Juan Aviles
Juan Aviles
12,795 Points

I am having the same problem with the same course. It started on Saturday morning for me. I contacted support just now so hopefully they can resolve it quickly.

1 Answer

Juan Aviles
Juan Aviles
12,795 Points

Hi Stephanie,

I was having the same problem as you and I contacted support. I was told that it was my code that was causing the problems, and to paste my code in the forums for them to address. They wanted it in the forums in case others had problems, and since you already had this post started, I figured I would add it here. This was their last reply:

"Hi Juan,

Thanks for getting back to me! I've just checked in with our developers, and it's actually your code that's causing the issue. Please post this with your code on the Forum. Once you've posted this, our teachers can then provide assistance once they've returned to the offices. We aim to address most questions such as this on our forum so that others who may have similar issues can see it posted there and save them the time of awaiting a reply from one of our teachers.

Please let us know if you have any additional questions about this! "

<?php

define("YEAR", 2014);
define("JOB_TITLE", "Teacher");
define("MAX_BADGES", 150000);  

//Invalid constant name
//define("2LEGIT", "to quit") Can't start with an integer  

$name = "Mike";
$location = "Orlando, FL";
$full_name = "Mike The Frog";
$name = $full_name;

?>

<!DOCTYPE html>
<html>
  <head>
    <meta charset=utf-8>
    <title><?php echo $name?> | 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;
          $three = 3;
          $string_one = "1";

          $distance_to_home = 1.2;
          $distance_to_work = 2.5;
          $greeting = "Hello, Friends!\n";
          $greeting{0} = "J";
          $secondary_greeting = "How are you today?";
          //echo $greeting;
          //echo $secondary_greeting;

          $bool = TRUE;
          //var_dump($bool);
          $bool = FALSE;
          //var_dump($bool);

          var_dump((bool) "abc");
          var_dump((bool) 10);
          var_dump((bool) 10.0);
          var_dump((bool) array());

          echo YEAR;
          echo JOB_TITLE;

          $array_example = array();

          //print_r($array_example);
          $array_example = ();


        ?>
      </pre>


<!--
      <ul>
        <li><?php echo $one + $two - $three; ?></li>
        <li><?php echo gettype ($string_one); ?></li>
        <li><?php echo $distance_to_work + $distance_to_home; ?></li>
      </ul>
-->

    </section>
  </body>
</html>