Re: PHP Notice: Undefined index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Thanks.

I see it, I get it, it makes sense. But it seems like overkill.

So what version did this become necessary in?
> http://php.net/isset

New server, new version. Or I had errors turned off on the old server.

Thanks!
John

elseif (
(isset($_POST["number"])) and (isset($_POST["submitter"])) and (!isset($_POST["finalize"])) and
($number) and (!$submitter)# and (!$finalize)
){
?>
<div class="special1"><h3>Step 99: <?php echo $submitter; ?>, You did not enter your name.</h3> We are sorry. Please <a href="<?php echo $PHP_SELF; ?>">Start Again</a></div>

<?php
}



Richard Lynch wrote:

is provoking

[Fri May 19 19:05:10 2006] [error] PHP Notice: Undefined index:
submitter in
/home/jtjohnston/domains/jtjohnston.ca/public_html/comments.php on
line 29


Because $_POST['submitter'] is not set?
Because your script assumes it IS set?

Because sometimes your script is called to display the form, before
$_POST['submitter'] has anything in it, and sometimes it's called
after they hit submit and it has something in it?

if (isset($_POST['submitter']) && "yes" == $_POST['submitter']){

http://php.net/isset


--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law."

''' Cégep de Sherbrooke:
ô¿ô http://www.cegepsherbrooke.qc.ca/languesmodernes/
- 819-569-2064

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux