I had my server upgraded to php 5.2 and included error messages for debugging. Not a good thing - as they are all over the place with scripts that have been in place for years.
So, I need some help knowing how things need to be written differently in php 5.2 that are no longer valid from earlier versions of 4.
For example, I get this notice: Notice: Undefined index: submit in /var/www/vhosts/domain/httpdocs/Directory/form.php on line 270
line 270 reads: if ($_POST == "Submit Search") {
list_matches ("42directory");
}
What need to change here?
Also, after submitting a form that inputs to a database, I get this notice:
Notice: Array to string conversion in /var/www/vhosts/domain/httpdocs/Directory/search.inc.php on line 23
That line is part of a clean array function:
function clean_array ($array, $remove='submit') {
// global $remove;
$remove = array ('submit' => '');
if (is_array ($array)) {
$array = array_filter ($array, "strlen");
$array = array_filter ($array, "addslashes");
while (list ($key, $val) = each ($array)) {
if (!trim_array ($key, $remove)) {
$clean_array[$key] = $val;
}
}
return $clean_array;
} else {
return 0;
}
}
What is wrong with this one?
I know these are just notices, not errors, but it would be nice to clean all this up, and leanr a little more about php 5 in the process.
Rick