-2

I'm not sure if this is an issue with WAMP but I have been having issues with php variables not being saved. Here is an example:

Works:

<?php 
 $x = "Hellow Wolrd!";
 echo $x;
?>

Hellow Wolrd!

Doesn't Work:

<?php 
 $x = "Hellow Wolrd!";
?>
<html>
<body> 
<?php echo $x;?>
</body>
</html>

RickyTamma
  • 182
  • 3
  • 13

1 Answers1

1

A blank page is either generated because the page extension is not PHP or because of a typing error in your PHP code. Try turning on error reporting on top of your PHP file by adding this as the first lines:

<?php 
error_reporting(E_ALL);
ini_set('display_errors', 1);

Perhaps you forgot a simple semicolon or bracket somewhere. Error reporting would hint you what lines you should check.

Gilles Lesire
  • 1,237
  • 17
  • 33