$ _GET。未定义的变量。不能找到解决方案 [英] $_GET . Undefined Variable. Cant find solution

查看:800
本文介绍了$ _GET。未定义的变量。不能找到解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图从URL中获取参数,但PHP坚持说变量没有定义。



网址是

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

脚本就像

 <?php includeheader.php; ?> 

< section id =stats>
显示<?php echo $ GET _ [date]; ?>
< / section>

最后,错误:

显示
的趋势注意:未定义变量:GET_ C:\xampp\htdocs\trendwatcher\index.php第4行

有人有任何想法吗?



谢谢!

解决方案

修复您的代码:

 < section id =stats> 
显示<?php echo $ GET _ [date]; ?>
< / section>

 < section id =stats> 
显示<?php echo $ _GET [date]; ?>
< / section>


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!

解决方案

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>

这篇关于$ _GET。未定义的变量。不能找到解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆