quote:
Originally posted by k776
ok, print_error() is on the form in this code:code:
<? if (array_key_exists("No catid",$errors)) print_error($errors["No catid"]); ?>
One for each part of the form I want to check. It displays it on the form for me.
Oh, OK. Well, I'm stumped.
I can't spot any obvious problems in your code.
Do the errors work properly? If you leave a field blank and submit the form, you see the error? Is the inserting into the database the thing that doesn't work? If so, then the problem might be that count($errors) is returning something other than 0. Maybe you should do a foreach($errors) just for debugging, and see what's making it not 0.
quote:
Next, Thanks for the link, checking now.............. dont understand. How can I check if magic quotes is enabled?? Can you use the code in add.php to give me an example??
OK... I modified the code on php.net to ADD slashes if magic quotes is disabled. It will make sure all the values in $_REQUEST are ready to be used in the MySQL query.
code:
if (!get_magic_quotes_gpc()) {
function addslashes_deep($value) {
$value = is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value);
return $value;
}
$_REQUEST = array_map('addslashes_deep', $_REQUEST);
}
$catid = $_REQUEST['catid'];
// etc...