how to use Swup transition library with php for page transition?

I have 5 php pages the last page is the one that actually submit the all the 5page data to database. and each page has a form and submit and open the other page
so i want to add page transition while each page form get submit and i was working with swup, without the php it’s works . but adding the php the transition doesn’t work.