Interplanetary magnetic effects of solar flares: Explorer 18 and Pioneer 5