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

277 points
3c0e59191662556e728dfeda72b54ef7?s=140&d=retro
Submitted by
Las625
over 5 years ago

Why do I get a strange result when I submit code?

Here is my code:

<!-- Add your PHP code between the tags! -->

$myFirstVariable = 0; <?php echo $myFirstVariable; ?>

this is the result: $myFirstVariable = 0; Undefined variable: myFirstVariable (line 9)


1 vote

permalink

See those <?php ?> tags? If you don't put your PHP code between them then it will not be recognized as PHP code.

Your $myFirstVariable = 0; is just being rendered as some text on an html page.

3698 points
55df2afa95e3787b9200005e_359368177
Submitted by
Judy
over 5 years ago

2 Comments

3c0e59191662556e728dfeda72b54ef7?s=140&d=retro Las625 over 5 years ago

Thank you AlbionsRefuge!

55df2afa95e3787b9200005e_359368177 Judy over 5 years ago

Happy to help.