Notice: Undefined index

I am coding a forum and when my website comes to create_topic_parse.php which is the code for creating a new topic I get this error:

Notice: Undefined index: cid in D:\wamp\ w.ww \forum\create_topic_parse.php on line 17

I’ve checked over the code several times but I can’t find a solution

Undefined index typically means you are not verifying if a request variable is present. For example:

[php]
$cid = $_REQUEST[‘cid’];[/php]

If “cid” is not present in a _GET or _POST then it will return undefined index. The proper method would be to verify

[php]
$cid = (isset($_REQUEST[‘cid’]) ? $_REQUEST[‘cid’] : null); // null is the default value of $cid[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service