I could set up a website using XAMPP and then when I have rented a server all I need to do is move the data over.

This way I wouldn't have to pay before setting the website up, I could just move the data over without even having the server rented out, would that be possible or would I have to rent the server and then code the webpages. You can make a HTML page without having a server and you can use XAMPP for server side languages like PHP but could you do this for your whole website?