<html> <head><title>Сайт</title></head> <body> Вася ходил по льду и <? if ($abc==1) { echo'подскользнулся'; } else { echo 'упал': } ?> </body> </html>
<? include'inc.php'; /* inc.php <? if ($_GET['x']==1) { $content = 'подскользнулся'; } else { $content = 'упал': } ?> */ ?> <html> <head><title>Сайт</title></head> <body> <table width="500" height="200" border="1" align="center" cellpadding="1" cellspacing="1"> <tr> <td width="539" height="193" align="center">Вася ходил по льду и <?=$content;?></td> </tr> </table> </body> </html>
<html> <head><title>Сайт</title></head> <body> Вася ходил по льду и <?php if ($abc==1): ?> подскользнулся <?php else: ?> упал <?php endif; ?> </body> </html>
<? $param = array ( "title" => "sitename" "body" => "text" "foot" => "footertext" ); ?> <html> <head> <title><?=$param['title']?></title> </head> <body> <?=$param['body']?> </body> <?=$param['foot']?> </html>
<?php //$html = file_get_contents('page.html'); $html = '<html> <head> <title>{TITLE}</title> </head> <body> {CONTENT} </body> </html>'; $title = 'Error 404'; $text = 'Page not found'; if(!isset($_GET['page'])) { $title = 'Main page'; $text = 'Welcome to site'; } else if($_GET['page'] == 'ip') { $title = 'View ip'; $text = 'Your ip: '.$_SERVER['REMOTE_ADDR']; } $html = str_replace('{TITLE}', $title, $html); $html = str_replace('{CONTENT}', $text, $html); echo $html; ?>