我包括payment.php,但仅在if图像类型等于“map”的情况下,否则其他html内容不包括payment.php。
例如
<?php
include('aaa.php');
$url=$_GET['url'];
$sql = "SELECT * FROM maps WHERE url='$url'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$name=$row['name'];$metaTitle=$row['metaTitle'];$metaDesc=$row['metaDesc'];$metaKeyword=$row['metaKeyword'];$imageType=$row['imageType'];
?>
出现一些内容。我需要为下面的行编写php代码
if imageType(name of field in table)= map
then include external file "payment.php"
else
html content without indluding payment.php file.
答案 0 :(得分:2)
if($imageType == "map") {
include('payment.php');
}
//html content here