【发布时间】:2012-11-09 14:01:00
【问题描述】:
在我的 php 页面中,出现“未定义索引类型”的错误。但是,如果使用字符串打开相同的 URL,例如mypage.php?type=abc 那么这个错误就不显示了!
我想将不带字符串的用户重定向,即从 mypage.php 重定向到 mypage.php?type=abc
我决定更好地纠正 php! php代码如下
<?
if (($_REQUEST["type"] == "mz") || ($_REQUEST["type"] == "ie") || ($_REQUEST["type"] == "iea")) {
?>
<link rel="SHORTCUT ICON" href="icons/<?= $_REQUEST['id'] ?>_favicon.ico" type="image/x-icon">
<?
}
?>
<?
if ($_REQUEST["type"] == "mza") {
?>
<link rel="icon" href="icons/<?= $_REQUEST['id'] ?>_extra_animated_favicon.gif" type="image/x-icon">
<? } ?>
2行和最后一行有错误
【问题讨论】:
-
用PHP直接输出默认内容而不是重定向用户不是更好吗?
标签: javascript string types indexing undefined