When not logged in you can type URL for this page into browser and the form is still displayed. If not logged in I don't want the HTML to show - just the message saying have to log in. I'm using same session code on other pages and it works - but does give a notice of 'undefined index' which is a bit irritating. Any ideas?
<?php
session_start();
if ($_SESSION['first_name']&& $_SESSION['username'])
echo "Welcome ".$_SESSION['first_name']."<br><a href='login/logged_out.php'>log
out</a>";
else
die("You must be logged in. Click <a href='login/login_page.php'>here</a> to log
in.");
?>
<html>
<head>
</head>
<body>
<form id="1" class="rounded" action="test4.php" method="post"/>
<input type="submit" name="submit" class="button" value="5" />
<form id="2" class="rounded" action="test4.php" method="post"/>
<input type="submit" name="submit" class="button" value="6" />
<form id="3" class="rounded" action="test4.php" method="post"/>
<input type="submit" name="submit" class="button" value="7" />
<form id="4" class="rounded" action="test4.php" method="post"/>
<input type="submit" name="submit" class="button" value="8" />
<form id="5" class="rounded" action="test4.php" method="post"/>
<input type="submit" name="submit" class="button" value="9" />
<form id="6" class="rounded" action="test4.php" method="post"/>
<input type="submit" name="submit" class="button" value="10" />
</form>
</body>
</html>