How could i use a php die function to only stop certain divs from loading? I understand it probably wouldnt be the exact same as die, but how could i stop only specific divs from loading? So i want the learn “col” and “col last” not to load, but for the div id bar to load. Also, how to i make it so the H2 tag in the if statement does not apply to the table in the else statement?
<html>
<body>
<div id="header">
<div id="site">
<h1><a href="#">site</a></h1>
</div>
<div id="menuholder">
<ul id="menu">
<li><a href="index.html">Home</a></li>
<li class="active"><a href="about.php">about application</a></li>
<li><a href="#">register</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>
<div id="teaser">
<div class="wrap">
<div id="image"></div>
<div class="box">
<?php
session_start ();
if (isset($_SESSION['username']))
echo "<h2>Welcome, ".$_SESSION['username']."!</h2>";
else
die("You must be logged in to view this page.
Register to gain access to learn more about the application.
<form action='login.php' method='POST'>
<table>
<tr><td>Username: </td><td><input type='text' name='username'/></td><td>Password: </td> <td> <input type='password' name='password'/></td> <td><input type='submit' name='submit' value='Login'/></td></tr>
</table>
</form>
");
?>
<p>Information about the application would go here</p>
</div>
</div>
</div>
<div id="bar">
<div class="wrap">
</div>
</div>
<div class="wrap">
<div class="col">
<h3>Learn <span class="red">More</span></h3>
<p>More info </p>
</div>
<div class="col">
<h3>User <span class="red">Statistics</span></h3>
<p>More info</p>
</div>
<div class="col last">
<h3>About <span class="red">Phapsy</span></h3>
<p>More info</p>
</div>
</div>
<div id="footer">
<p class="right">Contact: </p>
</div>
You can’t.
die()indicates to PHP to stop processing any further.This, however, would work:
And then elsewhere…