Yes, this is what I am trying to accomplish. With my lack of understanding PHP I didn't get your code to work though.
But that may no longer be necessary, because I made an error in reasoning. I overlooked that the success page itself is an order confirmation and the confirmation email only repeats the information. Like the confirmation mails, the success page has to show different information for orders coming from Germany and outside Germany.
At the moment there is an UE behavior on the confirm page, that redirects to the success page. With the UE behavior on the success page working, I don't need the UE behavior on the confirm page anymore. This means I need another way to set the redirect.
As I wrote before, I have no local checkout behavior on the confirm page, because we don't use a gateway. What I would like to do is set a redirect on the confirm page, that sends customers with OrderShipCountryID "Deutschland" to checkout_success.php, and all other customer to checkout_success2.php. On the success pages I would then no longer need the if/else statement.
How can I use the information in the column OrderShipCountryID to redirect to either of the success pages?
I am sorry for making things so complicated.