This forum is now read-only. Please use our new forums at discuss.codecademy.com.

261 points
1837cd3b55fe216100ee844398de5176?s=140&d=retro
Submitted by
Blacky0892
almost 4 years ago

Why dont work?

On line 8, create a variable named $myName and set it equal to your name.
Make sure to end your PHP code with a semicolon.

    <!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <p>
          <?php
            $myName = "Blacky";
          ?>
        </p>
    </body>
</html>

When I clicked Save&Submit button, it dont work. Why?


1 vote

permalink

It might be a problem with the interpreter. I was having a similar problem even though it was correct. I added a bunch of semicolon's at the end and it finally registered for me.

2263 points
Picture
Submitted by
Jordan Nguyễn
almost 4 years ago


1 vote

permalink

same here, but I fixed it. just copy in the "help" code and change the value to your name.

397 points
53888fa280ff3325790030a1_138435731
Submitted by
hatcat
over 3 years ago


0 votes

permalink

It has worked, you have created a variable called $myName and set it to the string value of Blacky.

If you want to print it out you have to call the echo command to do so:

<?php
      $myName = "Blacky";
       echo $myName;
?>

530 points
69e5f23fb7bbe15785bd864e8606d6fa?s=140&d=retro
Submitted by
mustardnose
almost 4 years ago

1 Comment

55de654ce39efe9a4a000717_225845417 Fundi almost 3 years ago

Yes it works when you echo it.


0 votes

permalink

They don't say that you need to "Echo" it

1233 points
566354cc937676913a000061_638238020
Submitted by
DAGIROV Djamal
almost 3 years ago