WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting errors in the server log for cformsII plugin but don't understand why.

PHP Notice:  Undefined index: b in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 12
[Tue Jul 12 15:02:26 2011] [error] [client] PHP Notice:  Undefined index: f in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 15
[Tue Jul 12 15:02:26 2011] [error] [client] PHP Notice:  Undefined index: f1 in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 18
[Tue Jul 12 15:02:26 2011] [error] [client] PHP Notice:  Undefined index: f2 in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 19
[Tue Jul 12 15:02:26 2011] [error] [client] PHP Notice:  Undefined index: a1 in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 21
[Tue Jul 12 15:02:26 2011] [error] [client] PHP Notice:  Undefined index: a2 in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 22
[Tue Jul 12 15:02:26 2011] [error] [client] PHP Notice:  Undefined index: l in /var/www/wordpressmu/wp-content/plugins/cforms/cforms-captcha.php on line 30

The url to the captcha image is http://mysite/wp-content/plugins/cforms/cforms-captcha.php?ts=3&c1=4&c2=5&ac=abcdefghijkmnpqrstuvwxyz23456789&i=i&w=115&h=25&c=#A6BEA4&l=000066&f=font4.ttf&a1=-20&a2=11&f1=17&f2=19&b=12.gif&rnd=448710

As you can see the variables throwing errors are included in the querystring.

The error is happening against this statement (prep being a function which strips slashes):

$im_bg_url      = 'captchabg/' . ( prep($_REQUEST['b'],'1.gif') );
share|improve this question
You know that you can (and should) accept answers to your question? That's important for how this site works, please see meta.stackexchange.com/questions/5234/… – hakre Jul 12 '11 at 14:49
You know that you can mark up a question if you find it useful? – JohnnyBizzle Jul 12 '11 at 15:08
You have asked six questions, that have garnered eleven answers; not one of those answers to any of those questions is correct? – Chip Bennett Jul 12 '11 at 15:19
up vote 1 down vote accepted

The cforms Wordpress Plugin you're using is not properly sanitizing input variables prior use, that's why you get the warnings.

You can either fix the problem your own if you're a coder, or report the issue to the plugin author and discuss if she can fix it.

But from what I googled, there is another version of that plugin, called cfomsII (Wordpress Plugin). It will probably have this issue already fixed so perhaps changing the plugin to the new version is the best suggestion to give.

share|improve this answer
That's the version we are using. I have put isset statements in front of all the REQUEST calls. – JohnnyBizzle Jul 12 '11 at 15:06
Still doesnt answer why I am getting Undefinded index when the querystring parameter is clearly there. – JohnnyBizzle Jul 12 '11 at 15:56
@JOhnnyBizzle: $_REQUEST should have a member for all get parameters. Probably it get's removed somewhere in the program flow? Checking with isset() however sounds valid. – hakre Jul 12 '11 at 16:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.