$value = ""; echo "<input name='ruta' type='text' size='50' $value/>"; if($_POST['campo'] == "") { $value = "../images/spacer.gif"; }