Contact Form 7 pass parameters (1 post)

  1. floydman
    Posted 6 years ago #

    Hi there,
    I found this great post, where mrchambers explained a hack on how to pass parameters to the form.

    He wrote:

    in plugins/contact-form-7/modules open up text.php.

    find the line:
    $value = $values[0]; (about line 73)

    and replace it with:

    $match = strpos($values[0], 'GET_');
    if ($match === false) {
    	$value = $values[0];
    } else {
    	$values[0] = str_replace('GET_', '', $values[0]);
    	if (isset($_GET[$values[0]])) {
    		$value = $_GET[$values[0]];

    In the latest version of Contact form 7 (2.2 last updated 2010-3-22 - download name: contact-form-7.2.2.zip) some code has changed. I can´t find the code in text.php:

    $value = $values[0]; in line 73.

    There is some similiar code in line 81:
    $value = isset( $values[0] ) ? $values[0] : '';

    If I replace this line completely with the code of mrchambers my whole wordpress installation is white;) Sorry i´m just a PHP newbie.

    Can someone give me an advice where to add the hack of mrchambers in the latest version of Contact Form 7?

    Thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic