0

I have a simple PHP page and for some reason when I visit it nothing appears what am I doing wrong? My code is below:

<?php


$hello = "Hello World!"

echo $hello;


?>
user3238125
  • 79
  • 1
  • 6
  • @AyushmanAshish Don't change code when editing questions. You change basically breaks the question of OP. – PeeHaa Jan 26 '14 at 19:10

5 Answers5

4

Your problem is that you forgot the semilcolon after you created the variable $hello. If you are not getting an error display you might have error reporting turned off you can turn it on in either your php.ini file or by putting ini_set("display_errors", TRUE); as the first line of code after you open the <?php tag

This should do the trick

<?php


$hello = "Hello World!";

echo $hello;


?>
Yamaha32088
  • 4,125
  • 9
  • 46
  • 97
4

set into your php.ini

ini_set("display_errors", TRUE);

and modiffy your code with

<?php $hello = "Hello World!"; echo $hello; ?>
Ashish Ratan
  • 2,838
  • 1
  • 24
  • 50
1

You don't end line with ;!

<?php

$hello = "Hello World!";

echo $hello;
Maciej A. Czyzewski
  • 1,539
  • 1
  • 13
  • 24
1

you did a mistake and your mistake is you don't give ";" after your second line

enter image description here

Ferrakkem Bhuiyan
  • 2,741
  • 2
  • 22
  • 38
1
<?php
$hello = "Hello World!"; // you forget to give ";" at the end off this line
echo $hello;  
?>
Ferrakkem Bhuiyan
  • 2,741
  • 2
  • 22
  • 38