Download Document 7760007

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Transcript
Multipurpose Pages
<?php } else { ?>
<!-- HTML content to display if condition is false -->
<?php } ?>
</body>
</html>
This code may confuse you at first, but in fact this is just a normal if-else
statement with HTML code sections that depend on the condition, instead of
PHP statements. This example illustrates one of the big selling points of PHP:
that you can switch in and out of "PHP mode" whenever you like. If you think
of <?php as the command to switch into "PHP mode", and ?> as the command
to go back into "normal HTML mode", the above example should make perfect
sense.
There's an alternate form of the if-else statement that can make your code
more readable in situations like this. Here's the outline for a multipurpose page
using the alternate if-else form:
<html>
<head>
<title> Multi-Purpose Page Outline </title>
</head>
<body>
<?php if (condition): ?>
<!-- HTML content to display if condition is true -->
<?php else: ?>
<!-- HTML content to display if condition is false -->
<?php endif; ?>
</body>
</html>
Okay, now that we have all the tools we need in hand, let's look at a sample page
of our site (samplepage.php in the code archive):
65
Document related concepts

Object-relational impedance mismatch wikipedia, lookup

Microsoft SQL Server wikipedia, lookup

Clusterpoint wikipedia, lookup

Open Database Connectivity wikipedia, lookup

Relational model wikipedia, lookup

Database model wikipedia, lookup