$var = ( array_key_exists('q', $_GET ) ) ? '?q='. $_GET['q'] : ''; echo '<iframe src ="http://www.google.ru/search'.$var.'" > </iframe> ';