title: PHP Variable Displaying - Not sure why?
body: <p>Ok got the code below working but it keeps displaying the q value at the top of each page. what do I need to change to stop this happening. I can see the echo value is that what the problem is if so what should I change it too in order to prevent value displaying? Many thanks.</p>
  
  <pre><code>// capture referral url
  $referringPage = parse_url( $_SERVER['HTTP_REFERER'] );
  if ( stristr( $referringPage['host'], 'google.' ) )
  {
    parse_str( $referringPage['query'], $queryVars );
    echo $queryVars['q']; // This is the search term used
  }
  
  // general form data insert
  $sql="INSERT INTO refer_kws (kwid, keyword, kwdate)
  VALUES('','".$queryVars['q']."',now())";
  
  if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
  echo "";
  
  mysql_close($con)
  </code></pre>