POST variable and PHP 7

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

 



Folks:

Consider a reentrant form. This is a form a user might be returned to if
they omit a field or enter some illegal value. It might look like this:

<input type="text" name="pizza" value="<?php echo $_POST['pizza']; ?>" >

The first time through, under PHP 7, this will error out, because there
is no 'pizza' index for the $_POST array. The $_POST array is empty.

Seems like I used to use this exact idiom under PHP 5, and it worked,
but under PHP 7 it doesn't.

Am I mis-remembering? If not, is there some common way around this under
PHP 7?

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com



[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