Here is a very basic html of what I am trying to do. The whole project is more complex, I'm creating a login site with js validation and php to verify username and password, and then submitting to either a guest page or admin page.
<!DOCTYPE html>
<html>
<head>
<title>Exam | Guest</title>
<meta name="keywords" content="exam, guest, cs319">
<meta name="description" content="Guest access page.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="exam.css" rel="stylesheet" type="text/css">
<script src="exam.js"></script>
</head>
<body>
<div id="container">
<h1>Guest</h1>
<?php>
echo "<h2> $_REQUEST["message"] </h2>";
?>
</div>
</body>
</html>
Now, as written above this works, the page loads. Likewise, if I replace the php element above with this:
<?php
if(isset($_REQUEST["message"])) {
}
else {
}
?>
The page also loads. However, if I take the echo element from the first example, and put it into the if(isset()) from the second element, like so:
<h1>Login</h1>
<?php
if(isset($_REQUEST["message"])) {
echo "<h2> $_REQUEST["message"] </h2>";
}
else {
}
?>
Then it doesn't work and the page doesn't load.