Contact Form 7: Set the Default Value for Select Fields Using the URL

Contact Form 7 and Default Select from URL VariableContact Form 7 is my favorite contact form plugin for WordPress. Not only is it well-documented on the developer’s web site,  but it offers a plethora of valuable features that have made it my go-to contact form. One of those features is Contact Form 7’s ability to use variables in the URL ($_GET variables) to set the default value for email form fields.

Contact Form 7’s documentation explains in detail how to set the default value of text fields to $_GET variables passed in the URL; however, as of this writing, it doesn’t tell you that you can also set the default value of a select field by passing the value of the field in the URL. Continue reading “Contact Form 7: Set the Default Value for Select Fields Using the URL”

Undefined Index: SCRIPT_NAME

Which PHPA WordPress plugin on one of my client’s sites was filling up the error log with a PHP error “undefined index” for the server variable SCRIPT_NAME. The error persisted through a number of plugin updates. I found that I could work around it by editing the plugin’s code and substituting the server variable PHP_SELF instead of SCRIPT_NAME, but it was a hassle to modify the code for the plugin every time there was an update, and I wanted to find a permanent fix. Continue reading “Undefined Index: SCRIPT_NAME”