我遇到了一个问题并且没有想法。
我正在尝试从URL中获取参数,但PHP坚持说该变量未定义。
网址为
http://localhost/trendwatcher/index.php?date=2014-10-18
脚本就像
<?php include "header.php"; ?>
<section id="stats">
Showing trends for <?php echo $GET_["date"]; ?>
</section>
最后,错误:
Showing trends for
Notice: Undefined variable: GET_ in C:\xampp\htdocs\trendwatcher\index.php on line 4
有没有人有任何想法?
谢谢!
答案 0 :(得分:1)
修复您的代码:
<section id="stats">
Showing trends for <?php echo $GET_["date"]; ?>
</section>
到
<section id="stats">
Showing trends for <?php echo $_GET["date"]; ?>
</section>