未定义的索引(is_numeric($ POST [

时间:2017-03-26 11:09:10

标签: php

我正在使用一个php表单,它将从URL获取cid。例如records.php?cid = 23

但是我在下一行中收到错误未定义的cid索引。

  

if(is_numeric($ _ POST [' cid']))

 if (isset($_GET['cid']))
    {
    // if the form's submit button is clicked, we need to process the form
    if (isset($_POST['submit']))
    {
    // make sure the 'cid' in the URL is valid
    if (is_numeric($_POST['cid']))
    {
    // get variables from the URL/form
    $cid = $_POST['cid'];

1 个答案:

答案 0 :(得分:2)

GET不是POST$_GET['cid']