php GET通知问题
调用“index.php?pConta=1&pDataInicial=01-01-2000&pDataFinal=31-12-2000”我收到此通知:
[08-Oct-2009 17:30:35] PHP Notice: Undefined index: pConta in index.php on line 1 [08-Oct-2009 17:30:35] PHP Notice: Undefined index: pDataInicial in index.php on line 2 [08-Oct-2009 17:30:35] PHP Notice: Undefined index: pDataFinal in index.php on line 3
index.php 源:
<?php
$conta = $_GET['pConta'];
$dtIni = $_GET['pDataInicial'];
$dtFin = $_GET['pDataFinal'];
?>
并且“var_dump($_GET)”向我显示以下内容:
array(3) { ["pConta"]=> string(1) "1" ["pDataInicial"]=> string(10) "01-01-2000" ["pDataFinal"]=> string(10) "31-12-2000" }
并且$conta、$dtIni 和 $dtFin 具有例外值。
Calling "index.php?pConta=1&pDataInicial=01-01-2000&pDataFinal=31-12-2000" I get this notices:
[08-Oct-2009 17:30:35] PHP Notice: Undefined index: pConta in index.php on line 1 [08-Oct-2009 17:30:35] PHP Notice: Undefined index: pDataInicial in index.php on line 2 [08-Oct-2009 17:30:35] PHP Notice: Undefined index: pDataFinal in index.php on line 3
index.php source:
<?php
$conta = $_GET['pConta'];
$dtIni = $_GET['pDataInicial'];
$dtFin = $_GET['pDataFinal'];
?>
And the "var_dump($_GET)" shows me following:
array(3) { ["pConta"]=> string(1) "1" ["pDataInicial"]=> string(10) "01-01-2000" ["pDataFinal"]=> string(10) "31-12-2000" }
And $conta, $dtIni and $dtFin have excepted values.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现问题了!我正在使用 xajax (一个 ajax php 库),它调用不带参数的 url。
I found the problem! I'm using xajax (an ajax php library) and it was calling the url without params.