Hundreds of thousands of people have been advised to stay out of the sun this week due to "dangerously hot conditions" forecast in two states.