所以我正在整理一个简单的 php 页面,它将根据输入的 url 显示不同的内容。出于某种原因,它似乎通过整个 if 语句而不做任何事情。
<?php
if(array_key_exists('offer', $_GET)) {
if( $_GET == "ncp" ){
$title = 'Exclusive Offer from NCP';
} elseif($_GET == "rt") {
$title = 'Exclusive Offer from RT';
} elseif($_GET == "oo") {
$title = 'Exclusive Offer from OO';
}
} else {
$title = 'Check Out These Exclusive Offers!';
}
$title = strip_tags($title);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo $title; ?></title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
<script type="text/javascript">
</script>
</head>