This code is returning an input who’s value is the $value variable
$value = "Analytics: \r\n\r\n --------------------------------------------\r\n";
$value .= "Campaign Source: ".$campaign_source."\r\n";
$value .= "Campaign Name: ".$campaign_name."\r\n";
$value .= "Campaign Medium: ".$campaign_medium."\r\n";
$value .= "Campaign Term: ".$campaign_term."\r\n";
$value .= "Campaign Content: ".$campaign_content."\r\n\r\n";
$value .= "First visit: ".$first_visit."\r\n";
$value .= "Previous visit: ".$previous_visit."\r\n";
$value .= "Current visit: ".$current_visit_started."\r\n";
$value .= "Times visited: ".$times_visited;
if (!is_array($tag)) return '';
$name = $tag['name'];
if (empty($name)) return '';
// add the value to the form's hidden input
$html = '<input type="hidden" name="' . $name . '" value="'. $value .'"/>';
return $html;
The last string in the $html variable "/> isn’t closing correctly in the rendered HTML and looks like some other type of double quote. You see in the image attached the double quote at the end of the input isn’t recognized, and it’s using the ending quote of the opening span tag. I tried replacing the $value variable in the $html variable with another single variable such as $times_visited and it rendered correctly. I think all the strings going into $value is throwing it off some how. Any ideas what’s wrong?
Thanks

this will never work with a
input. Even if you don’t have any issue with the double quotes I don’t think a value with newlines and<br>tags will work as an input value. You should either use a"<textarea style='display:none' name=\"name\">$value</textarea>"or use one<input>for each of the values you want to pass as hidden.