suddenly my site show new warning –
The relevant code:
printf ("<input type='text' name='C_Comment' value='" . $myComment . "' >");
The warning I get:
- Warning: printf() function.printf: Too few arguments
probably because $myComment is null.
-
I know I Can fix it if I first test if the value is null, and only then conctenate it. but is there a simpler way?
-
Why did not I get this warning before?
Thanks,
Atara
EDIT: sorry, wrong title. The problem was that $myComment was not NULL, it contained special character.
No, you get that warning because you don’t give enough arguments to
printf; probably$myCommentcontained printf placeholders like%s.Use
echoinstead if you don’t want to useprintf‘s formatting. You can also rewrite yourprintfcall:Make sure you’ve escaped special chars in
$myComment(seehtmlspecialchars).