$_GET . Undefined Variable. Cant find solution [cl

2019-03-07 06:59发布

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

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

The URL is

http://localhost/trendwatcher/index.php?date=2014-10-18

And the script is something like

<?php include "header.php"; ?>

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

And finally, the error:

Showing trends for 
Notice: Undefined variable: GET_ in C:\xampp\htdocs\trendwatcher\index.php on line 4

Does anyone have any ideas?

Thanks!

1条回答
Ridiculous、
2楼-- · 2019-03-07 07:52

Fix your code from:

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

to

<section id="stats">
     Showing trends for <?php echo $_GET["date"];  ?>
</section>
查看更多
登录 后发表回答