$_GET .未定义的变量.找不到解决办法

2022-01-04 00:00:00 get php url-parameters

我遇到了问题并且没有想法.

I'm having an issue and am out of ideas.

我试图从 URL 获取参数,但 PHP 坚持说该变量未定义.

I'm trying to get a parameter from the URL, but PHP insists in saying that the variable is not defined.

网址是

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:xampphtdocs	rendwatcherindex.php on line 4

有人有什么想法吗?

谢谢!

推荐答案

从以下位置修复您的代码:

Fix your code from:

<section id="stats">
     Showing trends for <?php echo $GET_["date"];  ?>
</section>

<section id="stats">
     Showing trends for <?php echo $_GET["date"];  ?>
</section>

相关文章