What is at line 20 - 25 of the checkout_ failure.php? the error is occurring at line 23, so it would be helpful to know the code producing the error.
This second part is a bit difficult, you would need to be proficient in java script to make the correct select list display depending on which shipping provider where chosen, then you would need to modify the code for the shipping provider to use the selected shipping method. If you are not comfortable with javascript, you may want to enlist help with this in the job board.