<?php ... $campoaleatorio=substr(campo1,0,2).substr(campo2,-3); ...?><input type="text" name="campo3" value="<?php echo $campoaleatorio;?>">