Skip to main content
Participant
September 2, 2009
Answered

array_key_exists('cancel', $POST)

  • September 2, 2009
  • 1 reply
  • 585 views

Good evening all,

I'm trying to work thru the David Powers book "The essential guide to Dreamweaver CS4"  In chapter 14 he's explaining how to create a form to delete records using the delete record server behavior.  I've created the form several times, always with the same error.

Remove RecordsWarning: array_key_exists() [function.array-key-exists]: The second  argument should be either an array or an object

and then a line number to the beginning of this code.  I've read a little that seems to imply that this might be a bug in php.  I'm using

PHP Version 5.2.9

if (array_key_exists('cancel', $POST)) {  
    header('Location: http://www.someplace.php');
exit;

any help is appreciated

A.

This topic has been closed for replies.
Correct answer David_Powers

Thanks for reading my book. The answer is quite simple. The superglobal array is $_POST, not $POST. Add the underscore, and it will work.

1 reply

David_Powers
David_PowersCorrect answer
Inspiring
September 2, 2009

Thanks for reading my book. The answer is quite simple. The superglobal array is $_POST, not $POST. Add the underscore, and it will work.

aikiartAuthor
Participant
September 3, 2009

Thank you,

That solved the problem.  Great book by the way.  I'm learning a ton.

Thanks

Art