I have a big project and my results page is permanent. So I need one permanent page with mutable content. So I have to use dynamic tags echo '<div>anything</div>';instead of static tags <div>anything</div>.
this is my structure :
// resultpage.php
<html>
<head>
<?php
switch ($_GET['arg']) {
case 'one':
$contents = '<div>content 1</div>';
break;
case 'two':
$contents = '<div>content 2</div>';
break;
?>
</head>
<body>
<?php echo $contents; ?>
</body>
</html>
Point: It actually $contentscontains more than 200 lines.
Now I want to know what happens for each request ?! In this model, will my bandwidth be empty? Is it better to create a separate file for each content (including static html tags)? something like that:
// content1.php
<html><head></head>
<body> <div>content 1</div> </body>
</html>
// content2.php
<html><head></head>
<body> <div>content 2</div> </body>
</html>
// And creating a php file contained switch() for selecting contents.
, ? , , , html php-?
, ajax, . ( html)? ( )
user4920811